Free Support Forum - aspose.com

Re: how to place double quotes around fields to be exported to CSV

Hi,

I don't find the problem you have mentioned. Which version you are using? Could you try the attached version.

Following is my testing code. The attached zip file contains input and output files with Aspose.Cells 4.5.0.16 component.

Sample code:

Workbook workbook = new Workbook();

workbook.Open("f:\\test\\CSVTest.xls");

workbook.Save("f:\\test\\outCSVTest.csv",FileFormatType.CSV);

Thank you.

Hi,

I don't find the problem you have mentioned. Which version you are using? Could you try the attached version.

Following is my testing code. The attached zip file contains input and output files with Aspose.Cells 4.5.0.16 component.

Sample code:

Workbook workbook = new Workbook();

workbook.Open("f:\\test\\CSVTest.xls");

workbook.Save("f:\\test\\outCSVTest.csv",FileFormatType.CSV);

Thank you.

Hi,

I was using Aspose.Cells 4.5.0.14. After I replaced it with your Aspose.Cells 4.5.0.16 It still generates the same CSV.

I noticed that in you CSVTest.xls file, you have double quotes around both the strings and currency data colulmns. My question is how do you add those double quotes to those columns? I do not use workbook.open to get my data into the worksheet , I use sheet.Cells.ImportDataTable(dtData, false, "A2") as I have show in my previouse post.

My goal here is to able to import my data into a workbook from a dataset and save it as a CSV file for the users to download using the stream object.

Attached are my xls after imported from dataset and the CSV after downloaded it from the webpage.

In my attached CSV file, you will see the string fields in the 3rd and 4th row contains double quotes and I do not understand how they got there.