Introduction
Info |
---|
This is Part 2 of the two-part tutorial series <i>Extended Sales Summary<i> scenario. It is recommended that you complete Part 1 - Copying Sheets before starting this section. |
Info |
---|
The sample code template (template.xlsx), page (Part2_CSV.aspx), and code behind (Part2_CSV.aspx.cs) are included in the ExtendedSalesSummary project available for download as part of the ExcelWriter Basics Tutorials. |
This part focuses on using ExcelApplication to create and populate a coversheet that includes user-supplied name, the current date, and a selected picture. It also includes data binding with ExcelTemplate.
Because this part of the tutorial demonstrates further capabilities of ExcelApplication, the code behind will be modified.
Writing the Code
Writing the code for the cover sheet comes in two parts. the first part uses ExcelApplication
to create a coversheet; and the second part uses ExcelTemplate
to bind the appropriate data to the data markers on the cover sheet.
Creating the coversheet with ExcelApplication
We want to create a cover sheet that looks like the following Excel worksheet: