views:

43

answers:

2

Hello, what is the most efficient way to create a xls file in a jsp page?

I created an xls file using poi in jsp page, but if not the most efficient.

Thanks

+2  A: 

A lot of times when I need to make an xls file, I create a CSV file instead and use that to generate the XLS. Obviously, creating comma-separated values is very simple and importing / opening a plain-text CSV file as an Excel document is equally easy.

I hope that helps in some way,

--gMale

gmale
+1 - CSV FTW :)
Russ Cam
Since the guy uses POI, CVS may not be sufficient for his needs already...
Vladimir Dyuzhev
He might not be aware about the ease of CSV.
BalusC
thanks !!, But when the user opens the file as xls not see with commas?
Maria José
no commas; but sometimes it's tricky to make Excel to show strings of specific formats as strings -- it "intelligently" converts them into dates, or numbers.
Vladimir Dyuzhev
gmale
thank you very much!!!!
Maria José
A: 

For cases more complex than CSV can handle (e.g. colourful formatting) I generate XML-based XLS file, which is very simple, almost like writing out HTML.

I never studied the format. Instead, I manually create the file in Excel, save it as XML, and write a code that produces a file of the same structure.

Vladimir Dyuzhev