English 中文(简体)
CSV files and multi line text cells
原标题:

I am generating a simple csv file using php. The file contains some user s personal data. When I open the generated file in office, the addresses are not displayed in full height. I have to double click on the cell for the address to be shown fully (in full width and height) otherwise I can only see the first word/number of the address. Also, I have date of births displayed as ######, I have to expand the whole column to see them fully.

This doesn t happen in open office.

Is there any way to force MS Office to show all fields in full? Because otherwise it ll be to confusing for the people who will use (Hey where are all the details!:)

Thanks :)

最佳回答

I don t think you can "format" your sheets with CSV. You will have to produce some other file format that Excel understands. I would suggest XML which is really easy to generate. Just make a sample sheet with the data you want, save it as XML and you ll see how your file should be generated. Or you could use some ready-made PHP solution for writing excel files if you can t be bothered with analysing the XML file.

问题回答

you could try the auto-size columns feature.

This is a UI issue with how Excel works, you can t force Excel or anything else how they handle it.

The quickest work around is to perhaps create an XLS file that runs a macro to retrieve the CVS file and format the cells as needed, but there s nothing you can do inside the CSV to affect what Excel is displaying.





相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签