Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8547625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:18:21+00:00 2026-06-11T13:18:21+00:00

Problem: Report Templates are created by Admin Users who only decide what data to

  • 0

Problem: Report Templates are created by Admin Users who only decide what data to show where as the filter for the data is specified by the business user. In simpler SQL terms, query is specified by the Admin User, Business User specifies the WHERE clause.

Jasper allows user to specify parameters in SQL query like $P{city}. I have tried to retrieve the query dynamically using the method specfied in the link.

Possible Solution can be

  1. Use WHERE clause parameters in JRXML and replace them while report creation – This will save me SQL parsing but I don’t want to guide the admin user with this complexity. Parsing is not a huge problem.
  2. Use my custom jdbc query executor and factory, only created to allow me extension point before jasper fire SQL query. I will be completely relying on vanilla Jasper JDBC data source but will only modify query before execution. JRAbstractQueryExecuter simplifies the query and replace the jasper related tokens before firing query – This will be very dirty and will force me to be implementation specific.
  3. Do the same replacement as it is done in JRAbstractQueryExecuter in my application code base, parse the SQL query, modify it and set it again as specified in link

Can you please suggest a better way of doing this? I have a feeling that this can definitly be done in cleaner way.

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:18:22+00:00Added an answer on June 11, 2026 at 1:18 pm

    You could create an input control to determine the desired WHERE clause and use a parameter to hold the contents of that WHERE clause. The default value expression would be something like:

     $P{theParameter} == "value_1" ?
         (" AND CONDITION_1 IN ('A', 'B', 'C') AND CONDITION_2 = 'Yes' "
         ) : " AND CONDITION_3 = 'Other' AND CONDITION_4 = 'No' "
    

    Then in your WHERE clause you would reference it like:

     WHERE
          .... = .....
          AND .... = ....
          AND .... = ....
          $P!{theParameter}
    

    If your constraint columns are the same across your WHERE clauses, you could use $P! to bring in the parameter value literally, and reference it in your query:

     WHERE
          .... = .....
          AND .... = ....
          AND .... = ....
          AND thisValue = $P!{theParameter}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem with a Crystal Report that displays data from a
Below is my backbone view. define([ 'app', 'backbone', 'twig', 'templates/report', 'data/reportViewCollection', 'data/reportViewModel' ], function
This problem relates to report design in BIRT. Due to limitations in the data
I have a problem with a report that is build using report builder 2.0,
i'v got a problem with the Report Viewer form .NET 2008. I'ave to get
I have the following problem: In my master report in the detail section i
I am using Jasper Report 4.5 My problem is I have list of employees
I have this problem having to display my jasper report on my grails application.
I have a cross-tab report which similar to this Problem is when there are
stackoverflow forum member I am having some problem with a certain report designed using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.