We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridExcelConverterControl

I am using GridExcelConverterControl to export a file to excel. A sample of the code is:
GridExcelConverterControl gecc = new GridExcelConverterControl();

if (grid != null)
{
gecc.GridToExcel(this.grid.Model,
workBook.Worksheets[0], ConverterOptions.ColumnHeaders);
}


6 Replies

MC Megan Clark November 22, 2011 02:46 AM UTC

I am using GridExcelConverterControl to export a file to excel. A sample of the code is:
GridExcelConverterControl gecc = new GridExcelConverterControl();

if (grid != null)
{
gecc.GridToExcel(this.grid.Model,workBook.Worksheets[0], ConverterOptions.ColumnHeaders);
}




MC Megan Clark November 22, 2011 02:51 AM UTC

I am using GridExcelConverterControl to export a file to excel. A sample of the code is:
GridExcelConverterControl gecc = new GridExcelConverterControl();

if (grid != null)
{
gecc.GridToExcel(this.grid.Model,workBook.Worksheets[0], ConverterOptions.ColumnHeaders);
}

The first time the file is saved, there are no issues. If the same data is saved multiple times the following error is received on either the second or third attempt:
"Index cannot be less than 0 and larger than Palette colors array size. Parameter name: index"

How do I prevent this error from occurring?



MC Megan Clark November 22, 2011 02:51 AM UTC

I am using GridExcelConverterControl to export a file to excel. A sample of the code is:
GridExcelConverterControl gecc = new GridExcelConverterControl();

if (grid != null)
{
gecc.GridToExcel(this.grid.Model,workBook.Worksheets[0], ConverterOptions.ColumnHeaders);
}

The first time the file is saved, there are no issues. If the same data is saved multiple times the following error is received on either the second or third attempt:
"Index cannot be less than 0 and larger than Palette colors array size. Parameter name: index"

How do I prevent this error from occurring?



RB Ragamathulla B Syncfusion Team November 23, 2011 05:12 PM UTC

Hi Megan,

Thanks for your interest in syncfusion products.

We are not able to see your reported issue in our current version. Please let me know you are currently using version. Thanks if any aditional information.

Let me know if you have any further concerns.

Regards,
Ragamathullah B.



OC Oliver Cole December 19, 2011 11:26 AM UTC

I'm also experiencing this issue, on v9.304.0.61.

Here is the trace:

Index cannot be less than 0 and larger than Palette colors array size.
Parameter name: index
at Syncfusion.XlsIO.Implementation.WorkbookImpl.SetPaletteColor(Int32 index, Color color)
at Syncfusion.GridExcelConverter.GridExcelConverterBase.CheckColorAvailability(Color color, IRange range)
at Syncfusion.GridExcelConverter.GridExcelConverterBase.CopyFont(GridStyleInfo gridCell, IRange range)
at Syncfusion.GridExcelConverter.GridExcelConverterBase.CopyStyle(GridStyleInfo gridStyle, IRange destRange)
at Syncfusion.GridExcelConverter.GridExcelConverterBase.CopyStyles(GridModel grid, Int32 iRow, Int32 iColumn, GridStyleInfo gridCell, IRange range)
at Syncfusion.GridExcelConverter.GridExcelConverterControl.GridCellToExcel(GridModel grid, Int32 iRow, Int32 iColumn, IRange range)
at Syncfusion.GridExcelConverter.GridExcelConverterControl.GridToExcel(GridModel grid, IWorksheet sheet, ConverterOptions options)




RB Ragamathulla B Syncfusion Team December 20, 2011 12:55 AM UTC

Hi Oli,

We regret for the inconvenience caused.

We have already logged a defect report regarding this issue and also i would request you to create a incident because we cant provide a patch via forum.

let me know if you have any further concerns.

Regards,
Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon