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

Preventing Report Generation from Scriptlet


hussainian

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

One way I'm doing it is using a function in PrintWhenExpression of all bands. This function in the scriptlet performs the logical part and returns TRUE or FALSE. So if the function returns TRUE, the bands are printed and if FALSE the report seems to be blank white page.

Though this solves the problem, but it seems illogical to go through all the report generation process even for the case when the report is not meant to be displayed. So is their any way we can stop the generation process in the start?

Thanks.

AsadUllah.

Link to comment
Share on other sites

Well! The work done. I'm using JasperServer to view reports. Now what happens that a very long and odd Stack Trace is printed on the screen. Is there any way to remove this track and print own message?

Thanks Lucian.

Asad.



Post Edited by hussainian at 03/07/2010 11:30 AM
Link to comment
Share on other sites

hussainian
Wrote:

Is there any way to remove this track and print own message?

I think you'd have to customize JasperServer for that.

Or you could do something else:  use your current report as a subreport, and perform the check in the master report.  If the check fails, print a text field with the message.  If the check succeeds, include the subreport (via its print when expression).

Or, a slightly better version of your solution:  use the report's filter expression to skip all records from the data source, and print a message in the "no data" band.  The report would still fetch all records from the data source, but it wouldn't perform any layout work.

Regards,

Lucian

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