This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Applying styles conditionally to an excel spreadsheet rendered as an xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Applying styles conditionally to an excel spreadsheet rendered as an xml" Watch "Applying styles conditionally to an excel spreadsheet rendered as an xml" New topic
Author

Applying styles conditionally to an excel spreadsheet rendered as an xml

Benjamin Samuel
Ranch Hand

Joined: Dec 15, 2006
Posts: 33
Hi,

I want to know how to apply styles to the rows of a generated spreadsheet, based on a particular condition.

The scenario is like this:

I have a jsp, jsp1 which displays a report. This jsp contains an 'export to excel' button, on click of which, another jsp, jsp2 is displayed with the report data rendered as an xml. Certain rows of the report is coloured, based on the property 'agingColor' of the report bean, reportLineItemBean.

I need to colour the rows of my generated excel sheet also in a similar way. But i was unable to do the same as i could specify only one interior(background) colour in a particular style. The code is as follows:



The above code displays the hexadecimal value of the agingColor along with the cell value, rather than applying that color to the styles. I need to apply the values for the background color for the cells as specified by the agingColor property, in a similar way the color #000000 is applied to the cells.

Please help.
Thanks in advance.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26201
    
  66

What happened when you tried adding another <style> tag?


[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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56222
    
  13

When using Struts, please be sure to post in the Struts forum. I have moved this post there for you.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Benjamin Samuel
Ranch Hand

Joined: Dec 15, 2006
Posts: 33
Jeanne,

Could you please elaborate on this? Could you provide me a sample code if possible?
Depending on the property i want to color the cell.

Thank you.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Applying styles conditionally to an excel spreadsheet rendered as an xml
 
Similar Threads
Templates Match under Microsoft namespace
Namespace question
styling in excel sheet
XMLSS to XML
Reduce Excel XML file size