Currently I am exporting the ultragrid thart has two bands. The format of exporting a grid with two bands doesnt look good in excel. Is there a way to only export the first band to one sheet and the second band to another sheet and link them together some how. Because at the moment, if i wanted to do a filter in excel against one column. the filter only works for one parent and child record only.
Below is what i currently have to export the grid
Hello,
I think that the easiest way to export each band in a separate worksheet is to get the underlying data table for the child band to set it as DataSource of grid object and then to export this grid object with the following override of public Infragistics.Documents.Excel.Workbook Export(
Infragistics.Win.UltraWinGrid.UltraGrid grid,
Infragistics.Documents.Excel.Worksheet worksheet,
int startRow,
int startColumn
)
method. You could do this with code similar to:
Workbooc wb = new Workbook();
Worrksheet sheet1 = wb.Worksheet.Add(Name)
ultraGridExcelExporter.Export(ultraGrid1, sheet1,0,0);
UltraGrid ug = new UltraGRid();
ug.DataSource = GetChildBand();
ultraGridExcelExporter.Export(ug, sheet1,0,0);
wb.Save(filename);
But I was researched and I was not able to find any suitable way to present a hierarchical data of type one to many in excel from two different worksheets.
Please let me know if you have any further questions.
How to get access to GetChildBand();
What class or library this functions is in?
This is what i have below i havent tried it yet.
Infragistics.Documents.Excel.
();
wb.Worksheets.Add(dlg.FileName);
ultraGridExcelExporter1.Export(ultraGrid1, sheet1,0,0);
ug.DataSource =
GetChildBand(); // THis line is giving me an error. dont know what getchild band is
wb.Save(dlg.FileName);