| 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
|
|
|
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
|
|
|
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.
|
 |
 |
|
|
subject: Applying styles conditionally to an excel spreadsheet rendered as an xml
|
|
|