Page tree

Versions Compared

Key

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

...

Code Block
DataBindingProperties dataProps = XLT.CreateDataBindingProperties();

Data Binding

1.Get the data for the Assets, Losses, and Other datasets

Info
titleFollowing the Sample

In the sample project, we are parsing CSV files with query results, rather than querying a live database. The CSV files are available under the data directory. There is a copy of the CSV parser, GenericParsing.dll in the bin directory of the project GetCSVData is defined in Part1.aspx.cs in a region marked Utility Methods.

These calls are to a helper method GetCSVData that parses the CSV files and returns a DataTable with the values.

Code Block

DataTable dtAssets = GetCSVData("//data//Assets.csv");
DataTable dtLosses = GetCSVData("//data//Losses.csv");

DataTable dtOther = GetCSVData("//data//Other.csv");

2. Create the datasets for the header row. Recall the optional modifier for the "Division" tag. This tutorial will not bind any data for that tag to demonstrate the function.

Code Block

//Create the array of header values. This example only binds a single item
string[] headerValues = { "2011" };



//Create the array of header names.

string[] headerNames = { "FiscalYear" };

Post-Processing

Final Code

...