When I try using Silverlight Excel engine to load excel documents, sometimes got the following error:
Not supported code pageParameter name: codePage at Infragistics.Silverlight.CodePageEncoding.GetEncoding(Int32 codePage) at Infragistics.Silverlight.Excel.SilverlightFixes.GetEncoding(Int32 codePage) at id.b(BinaryReader A_0, a A_1) at id.a(BinaryReader A_0, a A_1) at gq.a(BinaryReader A_0, a A_1) at id.c(BinaryReader A_0, a A_1) at id.b(Stream A_0) at Infragistics.Silverlight.Excel.DocumentProperties.b(ig A_0) at Infragistics.Silverlight.Excel.Workbook.a(Workbook A_0, Stream A_1, String A_2) at Infragistics.Silverlight.Excel.Workbook.a(Stream A_0, WorkbookFormat A_1, String A_2, IPackageFactory A_3, Boolean A_4) at Infragistics.Silverlight.Excel.Workbook.Load(Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) at Infragistics.Silverlight.Excel.Workbook.Load(Stream stream, IPackageFactory packageFactory) at Infragistics.Silverlight.Excel.Workbook.Load(Stream stream) at ExcelSL.MainPage.Button_Click(Object sender, RoutedEventArgs e)
I didn't found any information about code page in documentation. Which code page is supported now? And what can I do?
Hi treenode,
Supported encodings, based on the public help are "Besides the Unicode character encoding supported by Silverlight, the Excel Document Library supports Windows-1251 and Windows-1252 encodings."
Also in the last minutes we added Windows-31J (CP932)
So you can use any of these, for sure it will work if you save your excel page with Unicode.
Thanks,George
I have the same problem.
We cannot do a change in C# code :
...........
ExcelDataConnectionSettings excelDataSettings = new ExcelDataConnectionSettings { FileStream = fileStream, GeneratedTypeName = PivotGridStrings.XPG_ExcelFileDataSource_InitialCube, WorksheetName = PivotGridStrings.XPG_ExcelFileDataSource_WorksheetName }; ExcelDataConnectionSettings.AddExcelCellFormatMapping(PivotGridStrings.XPG_ExcelFileDataSource_ExcelFormatSrc, PivotGridStrings.XPG_ExcelFileDataSource_ExcelFormatDest); ExcelDataConnectionSettings.AddExcelDateTimeCellFormatMapping("d/m/yy;@", "M/d/yy"); flatDataSource.Cube = DataSourceBase.GenerateInitialCube(PivotGridStrings.XPG_ExcelFileDataSource_InitialCube);
..........
so it will import Excel documents saved with wrong encoding ?
How can i set encoding in Excel to Unicode?
When I run sumple code and import xls file everything is ok.
When I save xls file on may computer then i get error about wrong encoding.
(xlsx files work fine)
Hi gtachev,
Thank you for your help. I don't know how to change .xls codepage in Excel 2003, it seemed that change character set in web options have no effect. And I have even no idea how to check for .xls codepage.
I've upload the .xls document with problems in attachment. Would you please kindly see what codepage is it and whether could it be solved?
Regards,
treenode