Posted 8 September 2017, 3:13 pm EST
Hi,
Can you please tell me how to export farpoint to .xls and to .xlsx.
Thanks,
Forums Home / Spread / Spread for WinForms
Posted by: vimalaaron on 8 September 2017, 3:13 pm EST
Posted 8 September 2017, 3:13 pm EST
Hi,
Can you please tell me how to export farpoint to .xls and to .xlsx.
Thanks,
Posted 8 September 2017, 3:13 pm EST
Hi,
Here is a link to documentation about how to export XLS and XLSX:
http://helpcentral.componentone.com/NetHelp/SpreadNet7/WF/spwin-save-excelfile.html
Hope that helps! Please let us know if you have further questions.
Regards,
-Sean
Posted 8 September 2017, 3:13 pm EST
Hi Sean,
Thank you so much for your reply, When I export Far point to (.xlsx) format, its showing this error message “Excel cannot open the file ‘test.xlsx’ because the file format or file extension is not
valid. Verify that the file has not been corrupted and that the file extension matches the
format of the file”
I pressed ok for this message and when I open Excel the file is empty.
When I export to (.xls) format in some columns automatically adding decimals for example
234544.00 for the entire column. How to avoid this issue?
Thanks
Posted 8 September 2017, 3:13 pm EST
Hi,
Please try saving your .xlsx file with UseOOXMLFormat option of the ExcelSaveFlags enumeration. You can implement the same using the following line of code:
[csharp] FpSpread1.SaveExcel(@"D:\file1.xlsx", FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);[/csharp]
Also, I could not replicate the decimals related issue at my end. When I tried exporting the file in .xls format using the following line of code, there are no decimals in the resultant excel file:
[csharp] FpSpread1.SaveExcel(@"D:\file1.xls");[/csharp]
Please refer to the attached sample application implementing the same. Hope it helps.
Thanks and Regards,
Pragati Kaushik
2014/04/SaveAsExcel.zip
Posted 8 September 2017, 3:13 pm EST
Hi,
Is it possible to export with Custom Headers plus save as xlsx? So basically when i save as xlsx and open it says corrupt.
sample code:
sprVw.SaveExcel(“C:\excelfile.xlsx”, FarPoint.Win.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly)
or
sprVw.SaveExcel(“C:\excelfile.xlsx”, FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders)
Thank you
Posted 8 September 2017, 3:13 pm EST
Hi,
You can use “Or”. For example:
FpSpread1.SaveExcel(“C:\testfile.xlsx”, FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders Or FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat)
-Gina
Posted 28 September 2018, 11:30 pm EST
fpSpread1.SaveExcel(“d:\excelfile.xlsx”, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat | FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders);