Hi,
I worked in the "Importing from Excel" functionality, it is working fine with following code provided we need to set the Properties of the excel file to "Build Actions = Embedded Resource".
string resourceName = "ExcelWebGrid.Resources." + this.GetExcelFileName();
using (Stream stream = this.GetType().Assembly.GetManifestResourceStream(resourceName)) {
dataWorkbook = Workbook.Load(stream);
}.
This will work , if we have the Excel file in our current Project / Solution. But in my requirements , User will upload the Excel Document from their Local Machine. i need to read that excel file to display to the XamWebGrid, Please see the following code.
using (Stream stream = openDiaglog.File.OpenRead()) {
}
Invalid or unrecognized file format. Parameter name: stream
and the stack Trace will be at d.a(Stream A_0, String A_1, Boolean A_2, IPackageFactory A_3) at d.a(Stream A_0, String A_1, IPackageFactory A_2) 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 ExcelWebGrid.MainPage.TestExcel_Click(Object sender, RoutedEventArgs e)
My understanding on this issue is,
WorkBook.Load Method expects the "Stream" parameter. But in my code i am passing the "FileStream" as the parameter.
Please suggest the way to solve my issue.
Thanks, Thyagu.
Hi Thyagu,
Could you check the type of the excel file you are trying to open.The Excel saves the file by default in XLSX format, which is currently not supported by the library.
Thanks,George
Hi George,
From your reply I understand that xlsx format is not supported. Is there a timeframe by which you will be supporting this?
Thanks.
Hi Jason,
I notice that the Zip compression library is now available. Therefore, are you able to give a better indication of when XLSX support will be available for Infragistics.Excel?
Thanks,
Mustafa.
XLSX requires a Zip compression library. Since this is not available in SL, we could not support XLSX. We are releasing our own compression library in our 10.1 release which does give us the ability to do XLSX, so I would estimate you'll see XLSX support in the near future. I don't have a date yet, but the latest would be our 10.3 release in October.
Thanks
Jason
Hi there,
I have same question and problem, Could you please tell me when it will be available?