> Hi,
>
[quoted text clipped - 3 lines]
>
> Thanks!
Do you need special Excel-specific formatting? If not, the easiest way
to get the data into Excel is probably a CSV file, as Excel can open
CSV files without a problem.
If you need basic formatting, you can put your data into a formatted
HTML table and then save is as a file with an XLS extension - it's a
bit of a hack, but for simple purposes, it works just fine.
If you want to get fancy and export macros or something, well then,
uh... I dunno. ;)
AD1234 - 26 Mar 2008 23:31 GMT
> > Hi,
>
[quoted text clipped - 12 lines]
> If you want to get fancy and export macros or something, well then,
> uh... I dunno. ;)
Well. Thanks for a quick reply.
The stored procedure is not really complex. It is like (select top 10
* from clients).
The constraint is, it has to be a stored procedure. Not a direct SQL
statement.
Also, it should export results in Excel Sheet format. Not really well
formatting required.
If you can link up some example or some way it would be a good help.
Thanks!
Arne Vajhøj - 27 Mar 2008 00:33 GMT
> The stored procedure is not really complex. It is like (select top 10
> * from clients).
> The constraint is, it has to be a stored procedure. Not a direct SQL
> statement.
> Also, it should export results in Excel Sheet format. Not really well
> formatting required.
I assume you know how to call your SP using CallableStatement.
To write to Excel you have at least 3 options:
1) Write a CSV file which Excel reads fine. This is by far
the easiest.
2) Use Apache POI to write a XLS file.
3) Use JDBC ODBC bridge and ODBC driver for Excel to
write XLS file.
Arne
Lew - 27 Mar 2008 05:10 GMT
AD1234 wrote:
>> The stored procedure is not really complex. It is like (select top 10
>> * from clients).
>> The constraint is, it has to be a stored procedure. Not a direct SQL
>> statement.
>> Also, it should export results in Excel Sheet format. Not really well
>> formatting required.
> I assume you know how to call your SP using CallableStatement.
>
[quoted text clipped - 7 lines]
> 3) Use JDBC ODBC bridge and ODBC driver for Excel to
> write XLS file.
AD1234, "Excel Sheet" format is many formats - Excel excels at reading many.
There is perhaps an engineering reason why you think you need to use its
(current) native format? If so, please share it. If not, just use any format
that works. Preferably the easiest one to write from Java.
What does "Not really well formatting required" mean?

Signature
Lew
> Hi,
>
[quoted text clipped - 3 lines]
>
> Thanks!
Hi
Use FOP(XML,XSLT) for that