How to Use .JRTX Files to Apply Different Styling Based on Parameter Value

Posted on by By admin, in Jaspersoft | 0

Prerequisites:

Jasper Server 6.4.0

Database: Foodmart

In this blog, we will learn to use .JRTX files to change the background color of group header based on parameter Value.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Get your 30 Days Trail Version

  1. Created a sample report with stateName parameter which displays Storewise Sales and Cost



    Storewise Sales
  2. Create Template folder with three .jrtx files to change the group header color, in jaspersoft workspace



    Group Header Color
  3. Apply different colors to group header in CA.jrtx,WA.jrtx accordingly



    Different colors in group header



    Different Colors in Group Heading
  4. Add Style template reference in the report and select the workSapce resource (If template folder is not present in workspace then select Absolute Path and select the one of the .jrtx file from them in the file system)



    Adding Styles 



    Adding Styles

  5. After adding the .jrtx file in style edit the source expression of a template and.Pass the Parameter expression in the source expression  



    source expression

  6. Apply the group header style to stateName field of state group 

    group header style


  7. Deploy the report bypass and pass the Value to stateName Parameter the output will be

— For Parameter value CA







— For Parameter value WA

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Claim Your 30 Days Free Trail



Parameter value WA


logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

In case if you have any queries please get us at support@helicaltech.com

Thanks,

Neha Koyalwar

Helical IT Solutions Pvt Ltd

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments