In the past we have been exporting files as CSV's and the default reader has been Excel. Recently, the company introduced iPad. iPad treats CSV's quite differently (different escape character sequences) than Excel.
Is there a format which works with both iPad readers and Excel? I have Apache FOP and XALAN in place, but the translations I've built are for HTML and PDF. For business reasons, I need to maintain Excel compatibility.
How can I achieve Excel and iPad compatibility without having to detect the browser and execute two different implementations?
Notes
iPad can be read o开发者_Python百科nly, prefer editable. iPad has QuickOffice installed. Excel format has to be user editable.Have you ever tried to make a new Excel file with some sample values and save it as XML (inside Excel)?
Can you open this XML (which is a ExcelML) with QuickOffice? When yes, you can create a ExcelML from this CSVs so that they can be viewed and edited with both programs (QuickOffice and ExcelML). This transformation can be done with XSLT, but maybe it is easier to interprete this csv with a different language and write a basic ExcelML structure.
Another and maybe better approach would be (if you use Java) to write a native Excel with the csv as input data! Yes this is possible and works quite good: Look at Apache POI project.
When you use Apache POI you need to interprete the CSV by yourself and write it with Apache POI. Another recommendation for Apache POI is here .
Due to the fact that I need this to run not only in Quickoffice, but in the CSV reader for the web page itself I had to build in a workaround.
I chose to detect the browser and escape the reserved characters accordingly. This is not an ideal solution, but it works and its the only reliable solution I have been able to come across that works in Excel, Quickoffice and the native Safari CSV reader.
精彩评论