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.