aspose file tools*
The moose likes Servlets and the fly likes JSP/HTML to Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP/HTML to Excel" Watch "JSP/HTML to Excel" New topic
Author

JSP/HTML to Excel

brisk rook
Greenhorn

Joined: Jul 19, 2001
Posts: 20
Hi,
Can anyone help me fixing this.
I have a JSP application. The front end is in JSp & there's one main/central JSP which handles the user requests & manipultes them in the backend & responds back to the browser.
There is one webpage in which a table is displayed(based on users request). There is an option in the page to save this table as an EXcel spreadsheet. Till this point everything's ok, but when the table is being saved as an Excel then the values of few columns are abruptly getting changed(different from the values displayed in the webpage).
can anyone come out with a solution/suggestion..??
Raph Kuriyan
Greenhorn

Joined: Jul 19, 2001
Posts: 2
how are you writing to the excel file? If you're using jdbc dbc then there should be no problem on that front. The problem may lie in the data that is read by your jsp/servlet that is doing the conversion.
if you're using jdbc dbc to write to a particular excel file and then redirecting to this file, then you may have problems with other threads modifying the physical excel file on disk before you the user starts the download.

Originally posted by brisk rook:
Hi,
Can anyone help me fixing this.
I have a JSP application. The front end is in JSp & there's one main/central JSP which handles the user requests & manipultes them in the backend & responds back to the browser.
There is one webpage in which a table is displayed(based on users request). There is an option in the page to save this table as an EXcel spreadsheet. Till this point everything's ok, but when the table is being saved as an Excel then the values of few columns are abruptly getting changed(different from the values displayed in the webpage).
can anyone come out with a solution/suggestion..??

brisk rook
Greenhorn

Joined: Jul 19, 2001
Posts: 20
HI raph,
Thanx for your response. Infact we are using JDBC. The problem here's this is an application already being deevloped by someone else. I took over him after he left & i really need to rush up the things to fix this. U know how difficult would it be to get into someone's code & understand it.MOreover there's hardly any comments given in the code.. Would you plz suggest me a quickest way to locate jsp/servlet which does the conversion. I looked at a jsp file named saveTable.jsp which does this. but there's nothing significant in this..here's the code.

<% /**
Description:
Send table as tab-delimited text so browser
will prompt user to open or save.
*/ %><%@ taglib uri="jdeep.tld" prefix="jlb" %><%
response.setContentType("application/vnd.ms-excel");
String tableModel = request.getParameter("tableModel");
if(tableModel == null | | "".equals(tableModel) | |
"com.objx.protex.view.CETable".equals(tableModel)) {
tableModel = "com.objx.protex.view.RETable";
}
Object table = "table"; //hack for Tomcat3.2.1 bug: can't cast String to Object
%><jlb:createTable
id="table"
input="<%= tableModel %>"
scope="session"
sortable="true"
resetSortOrder="false"
force="true"
/><jlb:viewTable
table="<%= table %>"
tableFormat="tab"
applyFormats="false"
/>

would plz suggest me as to how i should go about it...???
Originally posted by Raph Kuriyan:
how are you writing to the excel file? If you're using jdbc dbc then there should be no problem on that front. The problem may lie in the data that is read by your jsp/servlet that is doing the conversion.
if you're using jdbc dbc to write to a particular excel file and then redirecting to this file, then you may have problems with other threads modifying the physical excel file on disk before you the user starts the download.


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16051
    
  21

Actually, what you have there is a custom tag that can take a set of model data and format it as a set of rows of tab-delimited data, which is one of Excel's available import formats. Not sure how to explain modified data - the model data either comes in from the URL or, if not supplied there is evidently synthesized. Your problem MAY be that the tag's not threadsafe.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP/HTML to Excel