Last post May 19, 2017 11:00 PM by bobdobby
May 19, 2017 02:16 AM|bobdobby|LINK
I have a coding background, but am new to ASP and Windows programming. I have a project, that requires creating microsoft word documents that are populated with data from a database. The idea was to have a word template so the formatting could be customisable.
My client, has a number of existing applications that run on Windows Server 2008, SQL Server 2008. And appear to be using .NET framework 4.5.2. That is where I got to ASP.
Be wondering if this sounds like a practical approach, my gut feel is that I should be developing on newer versions (.NET Core?). Would that seem reasonable. Would I need a new server to run the new application on, or could I run it on their old Server 2008,
with their existing apps.
Any advice/direction would be greatly appreciated.
May 19, 2017 10:18 AM|Eric Du|LINK
After reading to your description, I know you want to export the data from database to word format.
You could refer to this sample code:
protected void btnExportWord_Click(object sender, EventArgs e)
Response.Buffer = true;
Response.Charset = "";
Response.ContentType = "application/vnd.ms-word ";
StringWriter sw= new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.AllowPaging = false;
For more details, please check this tutorial:
Export GridView To Word Excel PDF CSV Formats in ASP.Net:
About this function, I know it doesn't need use asp.net core. Also I think it doesn't need a new server.
Also I found some tutorials about publish website and learn asp.net, please check:
How to: Deploy a Web Project Using One-Click Publish in Visual Studio:
You could start learn asp.net in here:
Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites;
therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure
that you completely understand the risk before retrieving any software from the Internet.
May 19, 2017 11:00 PM|bobdobby|LINK
I will give it a go.