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 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


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 "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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32635
    
215

Prasad,
Welcome to JavaRanch!

Can you post the first couple lines of your JSP?


[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
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: 63350
    
  70

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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32635
    
215

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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
Use a servlet, not JSPs.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unncessary empty spaces in excel file exported from websphere server
 
It's not a secret anymore!