Win7, Vs2010 , silverlight 4
Hi, When i try to run this code, it trows exception like that "The type initializer for 'SR' threw an exception." on Workbook.Load().
Code from http://help.infragistics.com/Help/NetAdvantage/Silverlight/2010.2/CLR4.0/html/SL_Getting_Started_with_Infragistics_Excel_Engine.html
private void Button_Click(object sender, RoutedEventArgs e){ OpenFileDialog openfileDialog = new OpenFileDialog(); Workbook workbook1; // Open dialog if (openfileDialog.ShowDialog() == true) { // If user selected a file get the stream of that file FileStream stream = openfileDialog.File.OpenRead(); // Load workbook with data workbook1 = Workbook.Load(stream); stream.Close(); } }
private
void
object
new
// Open dialog
if
true
// If user selected a file get the stream of that file
// Load workbook with data
i am just going to update this page because i almost wasted an half day for this issue and infragistic help forume and support really is not good in helping us so we have to help eachother .
Guys ! if you are getting this error you just need go and install "System.Text.Encoding.CodePages" from Nuget and them put " Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);" where you are reading the stream .
that is ALL !!!!
this error causes due to problem of reading Encode 1225 and would be solved by this solution only
Hello, We have look very deeply at this issue with our development team and after looking at the excel file we found that the error you are getting is because the encoding of the excel file is not currently supported by the Compression library. This was the case when I manage to reproduce the same error message loading excel file. The reason for the error is that the Excel library is trying to load codepage with number which is not currently supported. Currently the supported codepage formats are: 1200; 1201; 65001; 1251; 1252; 932; 936; 437; The error that you actually see is caused by the fact the excel is trying to find a supported format and load it. We will correct the error in order to be more informative. We have opened separate issue for correcting the error only - 60730.What you can do is to open a Feature request here in order to support the codepage that is not supported http://devcenter.infragistics.com/protected/requestfeature.aspxThank you.Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hi,
I have recently reproduced the same error with custom generated file and I have log it to our system as issue 60697 . If would attach a excel file I can verify for you if is the same issue and I will notify you when the issue get fixed.
Thank you.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Can you attached the file you are trying to open and I will see if I can create a sample with it.
extension of excel file in infragistics sample is *.xls. But extension of binary (BIFF) excel file format is *. xlsb, isn't it?