Aurora_Gaimon

JasperStudio: Alternate background colors using Frames and Styles

Blog Post created by Aurora_Gaimon Employee on Jul 28, 2017

JasperStudio is a powerful tool for developing our custom jasper reports. It offers many possibilities and capabilities without effort. Today I shall demonstrate a very nice trick on how to use using Frames with Styles, an easy way to alternate background colors for list items.

 

Let’s get started: 

  • Create a new Blank report.
  • Add a simple query to show active projects: code, name, description.
  • Add attributes into a Frame:
  • Create a style with a conditional style:  

 

 

  • Create an Expression to get the odd numbers or even numbers using REPORT_COUNT. For this demo I will use %2==1, but you could also use %2==0.

 

  • Ensure Transparent checkbox is unmarked and choose your background color:

 

  • Rename Style to something meaningful:

 

  • Go to the Frame and apply Style you we just configured:

It's ready! You can check the Preview:

 

 

 

 

If you need help with CA PPM and JasperStudio engage CA Services or ask questions in CA Communities.

 

That’s all. Thanks for reading until here. Did you like it? Please, don’t be shy and share it.

Outcomes