Jump to content
Changes to the Jaspersoft community edition download ×

Use of <style>..versus conditional styles


jewendt

Recommended Posts

I am about to create several dynamic reports utilizing ireport but I am struggling with deciding on a standard for making dynamic fields.  It seem like the most flexible way to do was to utilize the <style>...</style> tags inside of text expression editor setting things like font size, background color etc.  This however seems to have limitations 1). Setting properties this way only sets them for the font itself not the entire text box.  For example, setting the background color only changes the text background color it does not change the entire text box.  2). I cannot use this method to dynamically set things like frames and rectangles.  The other option is Style Conditions. These  work however when you want to change to dynamically change more than one attribute (for example font size and color) the number of combinations of style conditions required become excessive.  In addition, the "code" now is distributed between the report itself and the java code calling it (to set the conditions). Is there something I am missing with either of these options or is there a third option that I am not even aware of?

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

One think I would suggest is to use create base JRXML file with standard styles.

Then in Java or even better Groovy code parse mentioned JRXML and find needed elements. Change needed attributes on a fly and use newly dynamically created JRXML for report creation.

 

What do you think?

 

Best regards,

Taras Matyashovsky

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...