Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Excel Exporter not exporting
posted

Hi,

I want to export data from multile tables to the same workbook. But this is from a console application i.e. the grid is not on a form. The export does not work even if the tables have rows. The file has only the empty worksheets.

UltraGrid grid = new UltraGrid();

UltraGridExcelExporter excelExport = new UltraGridExcelExporter();

Report.Init();

 

DataSet dataSet = new DataSet();

//....adding 4 tables to the dataset and filling in with data

 

Workbook wb = new Workbook();Worksheet ws = wb.Worksheets.Add("Entitlements");

grid.DataSource = dataSet.Tables[0];

excelExport.Export(grid, ws);

grid.DataSource = dataSet.Tables[1];

ws = wb.Worksheets.Add(
"Resource Groups");

excelExport.Export(grid, ws);

grid.DataSource = dataSet.Tables[2];

ws = wb.Worksheets.Add(
"Action Groups");

excelExport.Export(grid, ws);

wb.Save(ConfigurationManager.AppSettings["E3_REPORT_FILE"]);