Jump to content
Changes to the Jaspersoft community edition download ×

Remove blank space when there is data that is not


jackdawson

Recommended Posts

Hi,

 

I have a master report and 2 subreports. One subreport prints the information about the 'requests from a brach of an organization' and the other prints on 'responses to a brach of an organization'. I passed a parameter <branch> from master report basing on which the subreports print their data.

 

SQL query in each of the subreports fetch the data belonging to all the branches. And, I could separate the data depending on the <branch> in the subreports. But the data that doesn't belong to the corresponding branch is not printed. That's kool.

 

But the problem is it leaves blank space in the subreport.

 

So, my question now is, how to remove the blank spaces/lines in the subreports?

The SQL query fetches the data but I used 'printWhenExpression' property not to print the irrelevant data.

 

Please help me in finding the solution for this.

 

Thanks.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

first of all I would use a where condition in your subreport based on your parameter, something like:

 

and branch_id = $P{my_branch_id}

 

If you really cannot proceed in this way, I would use a filter expression (see in the query dialog the button fielter expression)

If the filter expression still is not your favorite solution, I would put a print when expression at the detail band level (see the detail band properties).

And finally, if you want to use the print when expression on the textfields (like I suppose you are doing), check the flag "remove line when blank" and be sure the blank space that is supposed to be removed is not shared with other graphic elements like lines, rectangles, etc...

 

Giulio

Link to comment
Share on other sites

  • 4 months later...

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