Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We're done adding the data markers, so next we'll hook the template up to some data before we do any formatting.

Adding an ExcelWriter Reference in Visual Studio

Create a .NET project and add a reference to the ExcelWriter library.

  1. Open Visual Studio and create a .NET project.
    • The sample code uses a web application.
  2. Add a reference to SoftArtisans.OfficeWriter.ExcelWriter.dll
    • SoftArtisans.OfficeWriter.ExcelWriter.dll is located under Program Files > SoftArtisans > OfficeWriter > dotnet > bin

Writing the Code

Info

In the sample code, the a sample web application page Part1.aspx and code behind Part1.aspx.cs are available in the SimpleExpenseSummary directory.

...

Code Block
XLT.BindRowData(valuesArray, columnNamesArray, "Header", dataProps);
Info

If you want to import a row of data as a vertical column in Excel, you need to use ExcelTemplate.BindColumnData and the data marker syntax %%=$DataSourceName.ColumnName, with a $ to denote that the data should be imported as a column instead of a row.

7. Get the data for the Top 5 Expenses and All Expenses data sets.

...