Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
256 is not a valid column index in the current format. The value must be between 0 and 255.
posted

Hi,
I was trying to export the data from XamPivotGrid to Excel. I am facing the below issue.
Please help me over this.

Error details as below.
System.ArgumentOutOfRangeException : {"256 is not a valid column index in the current format. The value must be between 0 and 255.\r\nParameter name: columnIndex\r\nActual value was 256."}

Message : 256 is not a valid column index in the current format. The value must be between 0 and 255.
Parameter name: columnIndex
Actual value was 256.

Source : InfragisticsWPF4.Documents.Excel.v14.1

Stack trace :
at Infragistics.Documents.Excel.Utilities.VerifyColumnIndex(Worksheet worksheet, Int32 index, String paramName)
at Infragistics.Documents.Excel.WorksheetRow.GetCellAssociatedTable(Int32 columnIndex)
at Infragistics.Documents.Excel.WorksheetMergedCellsRegionCollection.VerifyMergedRegionArea(Int32 firstRow, Int16 firstColumn, Int32 lastRow, Int16 lastColumn)
at Infragistics.Documents.Excel.WorksheetMergedCellsRegionCollection.Add(Int32 firstRow, Int32 firstColumn, Int32 lastRow, Int32 lastColumn)
at Applications.Domain.PivotExportHelper.CreateWorkbook(XamPivotGrid pivotGrid) in c:\...\...\PivotExport.cs:line 115
at Applications.Domain.PivotExportHelper.ExportToExcel(XamPivotGrid sender) in c:\...\...\PivotExport.cs:line 50
at Applications.ViewModels.PivotAliasViewModel.ExportToExcel(Nullable`1 isFromView) in c:\...\...\PivotExportViewModel.cs:line 158
at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)

  • 17475
    Offline posted

    Hello Vish and thank you for posting!

    From the stack trace it seems that the column with index 256 does not exist and that is why it could not be accessed and exception is thrown. Please note that columns indexes are zero-based and in case there is 256 columns the indexes would be between 0 and 255.
    If you could share a sample project illustrating the issue I can have a look at the specific implementation and try to figure out where exactly the indexes are not correct. You can also have a look at the Samples Browser under XamPivotGrid->Data->Export to Excel sample that shows how the exporting is done.