Hi
In Ultragrid i have issue when i click on export excel,
there are 2 Events
1) Button click event for Export to Excel
2) Begin Export to make some columns visible after Exporting.
so here is my detailed scenario:
when i make my all columns hidden false in Begin_Export method throws object reference error in
ExcelExporter.Export(ugMappingGrid, location);,in the btnExportoExcel_Click.
If i comment these two lines
// e.Layout.Bands[0].Columns["MyColumn1"].Hidden = false;
// e.Layout.Bands[0].Columns["MyColumn2"].Hidden = false;
in Begin_Export it works fine.
private void ExcelExporter_BeginExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs e)
{
e.Layout.Bands[0].Columns["MyColumn1"].Hidden = false;
e.Layout.Bands[0].Columns["MyColumn2"].Hidden = false;
}
private void btnExportoExcel_Click(object sender, EventArgs e)
string location = string.Empty;
SaveFileDialog saveDialog = new SaveFileDialog();
saveDialog.Filter = "(*.xls)|*.xls";
saveDialog.DefaultExt = ".xls";
saveDialog.ShowDialog();
location = saveDialog.FileName;
if (saveDialog.FileName != "")
ExcelExporter.Export(ugMappingGrid, location); // Object reference error thows at this place
Hi,
How many columns do you have in the grid? Are there only 2?
My guess is that this is a bug that was fixed a long time ago and you just need to update to the latest service release.
How to get the latest service release - Infragistics Community
Totally i have 28 columns having data in few columns & some may not have too, in that 15 are visible in the grid, but while exporting to excel i need to show 22 columns, if i make any column visible in begin_Export event, i will get Object reference error in the method ExcelExporter.Export(ugMappingGrid, location)
We can upgrade our version in development environment but we can't do that in all client location who are all using Infragistics v9.2 is there any other alternate way to fix this problem without upgrade.
Thanks
Srivasta S