Just start by adding data placeholder markers into your report template.
Then write code to retrieve the data sets you need for your report.
Finally, with as few as 5 lines of codeDataTable dt = GetData();
ExcelTemplate xlt = new ExcelTemplate();
xlt.Open(“template.xlsx”);
xlt.BindData(dt, “Order”, xlt.CreateDataBindingProperties());
xlt.Process();
xlt.Save(Page.Response, “Output.xlsx”, false); , bind the data sets to the placeholders in your template to merge the data into the report.
|