I open an xlsx file thant i create with Excel and edit it with RadSpreadProcessing.
But then I can't display it in a RadSpreadsheet control. An error is displayed during execution on localhost.
Here is the error message:
Exception non gérée à la ligne 48298, colonne 17 dans http://localhost:53844/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:fr-CA:bc17b1ef-7a1b-49cb-a795-5f1c64597a53:ea597d4b:b25378d2;Telerik.Web.UI:fr-CA:b87b3d5b-f055-4852-bdaf-fef1991116e3:16e4e7cd:f7645509:22a6274a:33715776:8674cba1:7c926187:88144a7a:b7778d6c:c08e9f8a:59462f1:a51ee93e:24ee1bba:6d43f6d9:e330518b:1e771326:8e6f0d33:864068a5:6a6d718d:58366029:874f8ea2:4cd1fec6:71188da4:487c8be1:670fdf23:d944e0f6:c442ac3f:ec7335e:2e4adfe5:b4bec146:77613e24:69667591:a4c22f0d:e0037459:2f872eeb:75e7b247:b9057478:e8e3832e:728f182a:c4143936:5f88c545:6ed7f76e:32b48b51:935ec1c6:f0c58c30:16dc2978:1611ddf4:1bfaef2a:26e91122:c128760b:a7e79140:185812c5:f46195d3:6b3f73b3:2003d0b8:aa288e2d:b092aa46:a44b89c4:c8618e41:e4f8f289:1a73651d:16d8629e:2bef5fcc:a9b7ace7:e085fe68:52af31a4:5fa37e7e
0x800a139e - Erreur d’exécution JavaScript: Expected op «,» but found punc «;» (input: IF(D8<>0;E8/D8;0))
If a workbook was created with Excel, an error prevents it from being opened programmatically in a RadSpreadsheet control. Although it can be displayed there using the open button of the RadSpreadsheet. This error does not occur if you copy the contents of this workbook into the RadSpreadsheet and then save it with the save button on the RadSpreadsheet.
Thank you
To reproduce:
CultureInfo cultureInfo = new CultureInfo("es-ES");Exporting sheet properties corrupts the file and it cannot be opened in Excel.
In the latest version we export:
<sheetPr>
<pageSetUpPr fitToPage="true" />
<tabColor rgb="FF92D050" />
</sheetPr>
Excel cannot read this and tries to recover the file unsuccessfully. This works in R3 2020.
When a csv is exported the entire range which has values is exported. When export is done in Excel, the cells of this range which are empty are marked by an additional field, separated by a comma. This comma is present in SpreadProcessing only in places where it is obligatory for example in the middle of the row. Obligatory comma in this context means that without it the file will not be read correctly by Excel or SpreadProcessing. In places where it is not obligatory, like in an empty row or in the end of the row, it is skipped. These non-obligatory commas do not influence how the file will be interpreted by Excel, however, according to the most-popular csv spec, they should be present, which means that there could be parsers which are unable to parse the resulting file. (2.4 Each line should contain the same number of fields throughout the file.) Example: Exported by Excel: --------------------------------------- Product,Unit Price,Units in Stock,Discontinued Chai,$18.00 ,39, Chang,,17, Chef Anton's Cajun Seasoning,$22.00 ,53,No ,,, Chef Anton's Gumbo Mix,$21.35 ,0,No --------------------------------------- Exported by SpreadProcessing: --------------------------------------- Product,Unit Price,Units in Stock,Discontinued Chai,$18.00 ,39 Chang,,17 Chef Anton's Cajun Seasoning,$22.00 ,53,No Chef Anton's Gumbo Mix,$21.35 ,0,No --------------------------------------- Note the extra commas in the empty row and in the end of the first two rows in the SpreadProcessing sample.
The files are not properly recognized when the base64 string representing the exported XLS file is converted using https://base64.guru/converter/decode/file.
If an XLS file produced by MS Excel is converted with the same tool, it is generated with .bin extension.
When the column has cells that span several rows, the auto fit of column width is not working.
Workaround: If the document is being generated with the API, autofit the contents before merging the data.