Hi
When I try to export a grid with 42 columns (grid.DisplayLayout.Bands[0].Columns.Count == 42) i obtain this exception:
System.ArgumentOutOfRangeException
256 is not a valid column index in the current format. The value must be between 0 and 255.Nome parametro: columnIndexValore effettivo: 256.
Where can be the problem?
Thank in advance
This is the code with which I export the grid:
var ultraGridExcelExporter1 = new UltraGridExcelExporter(components); ultraGridExcelExporter1.Export(grid, pathTempFile); ultraGridExcelExporter1.Dispose();
Hi,
Excel 2003 and earlier has a limit of 256 columns in a worksheet. So something about your export must be exceeding that limitation. You say you have only 42 columns in your grid, so it must be something else.
Can you post the call stack of the exception so I can see what's happening when it occurs? It could be that your layout is causing those 42 grid column to be exported as more than 42 columns in Excel due to indention, hierarchical data, or using a RowLayout.
Or, it's possible that formulas or ValueList are causing the exporter to use a hidden worksheet which is exceeding the limit.
Also not that Excel2007 and up doesn't have the same limitation. So exporting to the newer format might be an option.