How to save Aspose grideweb into xlsx and csv format

Hi Aspose,

GridWeb1.WebWorksheets.SaveToExcelFile(“D:\book1.xls”);
The Above line of code is working when the file extension is Xls but when i change the extension to .xlsx or .csv its not working(only file is creating but unable to open that file).
Please provide the solution for this.

Hi,


You can use the overloaded member function “Save” as follow which specifies the Excel2007 or CSV format for saving the gridweb data:


GridWeb1.WebWorksheets.SaveToExcelFile(“abc.xlsx”, FileFormatType.Excel2007);

and

GridWeb1.WebWorksheets.SaveToExcelFile("abc.xlsx", FileFormatType.CSV);

Thanks & Best Regards

Hi,

Thanks for your posting.

Please download and use the latest version:
Aspose.Cells
for GridWeb v2.7.5.2002



In order to save to csv file, you can also use the following method.

GridWeb1.WebWorksheets.SaveCSVFile();

Please see the code below. I have attached both the source xlsx and output csv file.

Please see the screenshot.

C#


string filepath = @“F:\source.xlsx”;


//Import your save memory stream into GridWeb.

GridWeb1.WebWorksheets.ImportExcelFile(filepath);


GridWeb1.WebWorksheets.SaveCSVFile(filepath + “.out.csv”);



Screenshot:

Thank You Aspose Team.

Hi,

Thanks for your comments.

If you face any other problem relating to Aspose.Cells for GridWeb, please feel free to post, we will be glad to help you.