Good day.
After exporting filtered grid into excel I receiving datasheet with
After you export the list to Excel, I get a list with the errors in the first column:
Value can not be null. Parameter name: key
In programm, I have double-type values in this column. For example: 3; 33; 25.8
Why do I receive this error? Key value for this column is present and correct.
Code for export is very simple:
Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter exp = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(); string filename = StartupPath + "\\tmp.xls";exp.Export(my_grid, filename);
Hi,
If the grid encounters an exception while exporting the value of a cell, it exports the Exception so you can see that something went wrong. This usually only happen on formula columns, though. Does this column have a formula applied to it?
If so, something is probably going wrong while the exporter is trying to translate the grid formula into an Excel Formula. If that is the case, you might be able to get more information by trapping the FormulaExportError event of the UltraGridExcelExporter. Also, you could try setting ExportFormulas to false and see if the issue still occurs. That might be a viable workaround, if you just want to export the value and not the formula. And even if it's not a good workaround, it will, at least tell us if formulas are indeed the problem.
If the formulas are causing the issue, then my best guess is that you are probably using an older version of the controls and you should try upgrading to the latest service release.
If that doesn't help, then we probably need a sample demonstrating the error in order to help you any further.
I found solution of my problem.
1. There is no any formulas at this column. Just double-typed value.
2. Programm write its station at form_closing procedure:
gvMain.DisplayLayout.SaveAsXml(Application.StartupPath + @"\gvMain_" + Environment.UserName.ToLower() + ".xml");
3. At start, programm read its XML file:
gvMain.DisplayLayout.LoadFromXml(Application.StartupPath + @"\gvMain_" + Environment.UserName.ToLower() + ".xml");
Loading XMS always successfull, but sometimes I have values at the grid and have an error after export to Excel, as I wrote early.
After deleting XML file and re-saving them, probled solved.
P.S. Sorry for my English, it's not my native language.
Hello,
Thank you for your feedback, we are glad to hear that you were able to solve your issue. Please do not hesitate to contact with us if you have any further questions.
Thank you for using Infragistics Components