This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP Export to Excel with multiple pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Export to Excel with multiple pages" Watch "JSP Export to Excel with multiple pages" New topic
Author

JSP Export to Excel with multiple pages

Swarup Sarkar
Greenhorn

Joined: Jan 10, 2006
Posts: 1
I am exporting data into excel from my jsp page using,
<%response.setContentType("application/vnd.ms-excel");%>

It works fine.

What I would like to be able to do, however, is to create a new sheet (or tab if you prefer) for each table ( Suppose one table in jsp provides the information on employees and other table provides the information on departments).That means here two excell sheet will be created, one contains the information about employee and another contains information about department. Here I am not using any third party component like jxl etc.

Does anybody have an idea how to do this in jsp.

I would appreciate any help,

Swarup Sarkar
Prabhu Ramakrishnan
Greenhorn

Joined: Jan 09, 2003
Posts: 6
I don't think so. It�s not possible with JSP/HTML. JSP displays HTML content in Excel format that�s not a true Excel work book to display multiple work sheets.

When you decided to use different worksheet in a same workbook you have to use JXL or any other third party API.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32628
    
215

Swarup,
Welcome to JavaRanch!

Apache's HSSF is a good library for working with more complex Excel documents. I recommend using a servlet rather than a JSP since you will be dealing with a lot of Java code.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Export to Excel with multiple pages
 
It's not a secret anymore!