Unanswered: Data export to user defined Word or Excel template
I would need to know how to fill an XLS or DOC template document with data using ASP.NET.
Currently I am migrating my application form Access ADP/SQL Server to ASP.NET frontend. In Access I was using the following scenario
1. User defines a document template for Letter, Fax, Invoice etc. in Word. Fields that are going to be replaced are marked with tags like <Customer>, <Address>, <Zip>
2. The document is saved and moved into a common location on a network drive. (Will be probably SQL Server in new version)
3. When exporting data, Access opens the requested template and does Search and Replace of the tags using COM automation (Not available in ASP.NET). When generating a serial letter (like Invitation) every template page was copied and filled in a loop so the resulting document could have many pages.
The goal of this procedure was that user was able to define his own office templates without any involvement of a programmer.
Is something like this possible with ASP.NET? Especially the point 3 seems to be quite difficult.
Yes it does. It also means that you're opening instances of office components in-memory on your web server. This is very, very bad for scalability/stability.
Are you working with any kind of budget? One way to get this done is with Excel services for Sharepoint. However this route is prohibitively expensive for most non-enterprise scenarios.
If this is for an in-house need, another option would be to forgo ASP.NET in general and go down the winforms/WPF route. This would be MUCH less disconcerting if you opt to go the COM route. You do run in to the issue of making sure you've packaged and deployed dll's and that whole ball of wax, but I'd rather deal with that headache then running office automation in a multi user web environment.
After doing some search on internet it seems that the solution of my problem is Open XML file format for Office and Open XML SDK for Net. Open XML file format is supported for Office since 2000 so this is probably the best way.