Export to Excel using ASP

2019-06-01 01:48发布

问题:

At the time of exporting to excel using ASP. After converting a column in text format single quote is visible in the excel file. how to hide this automatically ?

回答1:

You might be helped by setting the style of your cell to mso-number-format:"\@", but I'd have to see your code to know the exact problem.

I think you might find Styling Excel cells with mso-number-format and Generate Excel files in ASP Classic useful.



回答2:

When you export to excel, you could juste make a table with cell, and put your value into double quote. Excel will read it correctly



回答3:

Here's the library I use, to export data to Excel 2007 (.xlsx) files.

It lets you export any DataSet, DataTable or List<> directly into an Excel 2007 file, using one line of code.

It's completely free, and you can download the source code (and see how to use it) here: http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm