It has been a while since my last post and I have gotten a few questions. One question was related to exporting reports to Excel.
This is actually pretty simple; you may have noticed the IReportExportToExcelV2 interface. This is the key to this task.
Basically the system report executor implements this interface and therefore you can use it to export.
Time for an example:
// First we need the engine
ISbaObjects sbaObjects = loader.GetSbaObjects(.........);
// Get a report descriptor
// Use the report descriptor to create a report executor
// Let's change a filter on the report
// just to show that you can modify the report before exporting
filterDate.DateFilter = DateFilter.Today;
// Now everything is ready and we can cast the
// executor to an IReportExportToExcelV2
= reportExecutor as IReportExportToExcelV2;
if (exportToExcel != null)
Pretty easy eh?