Search code examples
c#sql.netexport-to-excel

Export to Excel Templates in .Net


I was given an Excel template and asked to produce 'Export' button which then will export the data to that document.

I have a gridview and currently my export button is working as it should as in export all the data to excel, however now I should work on producing a similar looking template ( not sure how to upload it here) - basically the top two columns in Excel is the title then one row below and column E we have a small table with fields name: Staff ID, Name etc.

This section staff will edit after the data is exported, then below that the gridview data will be populated in.

I found a link that suggested uploading the template to server then using that however i am asked to create a stand alone application and that way will not work for different a branch (they'll have to upload the document to their server and then change the path in the code and thats not ideal).

anyone have any idea on how to design the layout in the code.

Many thanks ..


Solution

  • There are may libraries that allow you to export to excel and many of them will also allow you to create the document the way you want (merged cells, fills, formulas, etc.) I have use EPPlus but there are others