This is the logic I am using to create a workbook and then I save the workbook.
Infragistics.Excel.Workbook workBook = new Infragistics.Excel.Workbook();
ultraGridExcelExporter.Export(this.ultraGrid1, workBook.Worksheets.Add("Orders"));
ultraGridExcelExporter.Export(this.ultraGrid2, workBook.Worksheets.Add("POS Payment Totals"));
SaveFileDialog saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
saveFileDialog1.DefaultExt = "xls";
saveFileDialog1.FileName = "Order Inquire Export on " + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year;
saveFileDialog1.Filter = "Excel files (*.xls)|*.xls|All files (*.*)|*.*";
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
workBook.Save(saveFileDialog1.FileName);
}
saveFileDialog1.Dispose();
saveFileDialog1 = null;
workBook.Worksheets.Clear();
The issue I an having is ultraGrid2 is in a dock manager and is set to auto hide. If the flyout comes out the grid is initialized and the export works great. However if I never open up the grid then nothing is ever exported to the worksheet.
Any suggestions on how I can make this work with or without showing the grid?
Hi
This issue has been fixed and was applied to version 2009 Vol. 2 and newer since version 2009 Vol. 1 has been retired.
The latest service release for 9.2 is 9.2.20092.2083.
Thanks for all your help.
Hi,
I ran your sample, and there are no rows in the grid to export. So the sample doesn't really work to demonstrate the problem as is. So I added some rows and then in the button click event I checked the number of rows in the grid and it returns the correct number. So the grid itself is binding and getting the data correctly, it's just the export that is failing for some reason. So that's why setting the BindingContext doesn't work - that was never the problem.
Also... the first grid doesn't seem to have anything to do with the issue. I can remove the first grid from the sample entirely and the same problem occurs. So there must be something going on here with the grid on the DockPane that only affects exporting.
So I'm going to forward this thread over to Infragistics Developer Support so they can check this out and get it fixed.
Here is my sample. I hope I just have a setting that is incorrect.
You could attach your sample here if you like. When you post a reply, just go to the Options tab and you can attach a file. Be sure to zip up the project.
Or, if you prefer, you can Submit an incident to Infragistics Developer Support and include your sample there.