I am working on a POC and facing issues in getting few things done. I am trying to achieve below objectives:
1) We have to generate client side reports showing data in excel files.
2) These excel report files will be stored at web location and will have formulas, pivot tables, graph, etc.
3) At client side, we will pull data from various resources then fill the data dump in these excel reports.
While trying to achieve this, I am facing couple of issues:
1) How to pass web reference of excel file to "$.ig.excel.Workbook.load" function.
"Excel found unreadable content in *******.xlsx. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click yes".
I am not having this issue if excel template file does not have a pivot.
Following is the error that excel shows while repairing excel file:
Errors were detected in file 'C:\Downloads\Formulas.xlsx'-Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.-Removed Part: /xl/pivotTables/pivotTable1.xml part with XML error. (PivotTable view) Load error. Line 1, column 0.-Removed Records: Workbook properties from /xl/workbook.xml part (Workbook)
Thank you for posting in our community!
There is a topic related to your question "Read an Excel file into a Workbook" http://www.igniteui.com/help/excelengine-read-an-excel-file-into-a-workbook. I hope you will benefit from it also.
Thanks for taking a look. I am already using the suggested examples but they are not working in my case. I want to preserve the pivot information in the existing excel file template. But after adding a worksheet to an existing excel document, its get corrupted.
I am uploading following attachments.
1) Code file - importData.html
2) Excel template used - Inventory list1 - Copy.xlsx
3) Excel file after data is filled using code - NewExcelFile.xlsx
4) Repaired excel file and error file - NewExcelFile - Repaired.xlsx
Let me know if you can help. If this issue is resolved then I would like to know if we can load a excel file for web location (in your example, it is picking from local computer).
Thanks in advance.
Thank you for the provided sample and detailed information, it is highly appreciated.
The excel library does not support pivot tables and this is pretty likely to be the causing the issue. I am currently working in trying to workaround this behavior and will update you with my findings and on the other questions as well.
The issue with the worksheet getting corrupted needs a further investigation by the developers, so I logged it in our internal system. I have also used the duplicate support ticket (CAS-171824) to link to the issue. This way you will receive automatic notifications on the progress.
Regarding your other question:
The .load method itself does not accept a reference to the file but actually needs a data from which to load the workbook. (see http://help.infragistics.com/jQuery/2015.2/ig.excel.Workbook#methods:load)
In the import sample the FileReader API is used to read a local excel file into Uint8Array object, which is then passed to the .load method. In other scenario you may try XmlHttpRequest (server may need to allow CROS for this operation).
Please let me know if you have further questions.
To recover corrupt or damaged MS Excel file (.xls or .xlsx), I would like to refer Kernel for Excel recovery software. It is designed with an advanced algorithm to recover complete data with full accuracy. To know more about the software, visit: http://www.xlsx.excelfilerepair.org