wood burning stoves 2.0*
The moose likes JSP and the fly likes Unncessary empty spaces in excel file exported from websphere server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Unncessary empty spaces in excel file exported from websphere server" Watch "Unncessary empty spaces in excel file exported from websphere server" New topic
Author

Unncessary empty spaces in excel file exported from websphere server

Prasad Prasada
Greenhorn

Joined: Nov 26, 2009
Posts: 5
I am trying to export some contents to an excel file, from a jsp file using websphere server. All the contents are getting exported successfully, as it is, but the the contents in the first cell has lot of empty spaces appended before it. I have set the Cache-Control to "no-transform". I am using websphere server. Please let me know if you know a solution to remove the unncessary spaces.
Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 91

What is the API (like Apache POI) you are using to populate the data into Excel sheet..
Prasad Prasada
Greenhorn

Joined: Nov 26, 2009
Posts: 5
I am not using any API(like Apache POI) to populate the data into excel sheet. I am just using Expression language to populate the contents of excel sheet.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

Prasad,
Welcome to JavaRanch!

Can you post the first couple lines of your JSP?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Prasad Prasada
Greenhorn

Joined: Nov 26, 2009
Posts: 5
Hi,

i have only one line in the jsp, which writes the comma separated values using Expression Language.
The headers are set to appropriate values in java file.

Code in jsp: ${excelFile.csvtext}
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Why are you using a JSP to begin with? If you are constructing the CSV in the servlet, why bother with the JSP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

Prasad Prasada wrote:Hi,

i have only one line in the jsp, which writes the comma separated values using Expression Language.
The headers are set to appropriate values in java file.

Code in jsp: ${excelFile.csvtext}

That's it? No imports or anything before it? And I agree with Bear - there's no need to put on EL statement in a JSP.
Prasad Prasada
Greenhorn

Joined: Nov 26, 2009
Posts: 5
Please let me know the alternative solution for this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
Use a servlet, not JSPs.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unncessary empty spaces in excel file exported from websphere server
 
Similar Threads
download files with scandic letters
Exporting / Importing a file using hyperlink
Servlet sending an email
Excel - IOException Invalid Header signature
Generating Graphs using POI