• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applying styles conditionally to an excel spreadsheet rendered as an xml

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happened when you tried adding another <style> tag?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When using Struts, please be sure to post in the Struts forum. I have moved this post there for you.
 
Benjamin Samuel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic