Jump to content
We've recently updated our Privacy Statement, available here ×

Warn on JasperReports Server if parameter and control doesn't match


web_13

Recommended Posts

Hi!

I have Jasper Report created via Jasper Studio 6.12.2.
In this report there is a parameter "CompaniesIDs" of type java.util.Collection and it's used in SQL queryString like this: AND $X{IN, company, CompaniesIDs}
Report produces correct SQL and executes fine in Jasper Sudio.
Report is published on JasperReports Server. To use the parameter a Control of type Multi-select Query was created. The "Parameter Name" of control is "Companies".

Yes, I know the "Parameter Name" must match  the name of the parameter in my report.

The report has been run manually via web-panel.
The built sql from query log contains "0 = 0" instead of "AND company IN (11,22,33)".
What I was expecting is that JasperReports Server web-app gives some error message and will not let execute the report at all.

So the question is if is it possible to tune Server to get Fatal Errors in such cases but not only silently start execution.

Any suggestions appreciated.

Kind regards.

JasperReports Server:
Product Version: 7.8.1
Build: 20210726_1127

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello, I just bumped into your question now, not sure you still have that need but I'm wondering why you would need a fatal error. Would an empty report not be better? You could leverage the no data band in that case and display your personal message there instead.
You could for example use the $P!{paramName} to pass in a 1==0 in the query when the company ID is null in that case so that there is no data retrieved and Jasper will display the no data page.?

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...