Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress Page if Subreport <= 0

Status
Not open for further replies.

BB45

Technical User
Feb 3, 2005
42
US
CR 9
SQL 2000

Hi all,

I am trying to get my report to supress a full page of detail based on the Balance Due coming from a subreport. I have my shared var like this in the subreport based on a running total:

whileprintingrecords;
shared currencyvar BalanceDue;

BalanceDue:={#BalanceDue};

In my main report I have:

@BalanceDueShared
Whileprintingrecords;
shared currencyvar BalanceDue;

and in supressions I have:

{@BalanceDueShared} <= 0

and have even tried:

whileprintingrecords;
shared currencyvar BalanceDue;
BalanceDue <= 0

It still seems to evaluate based on the previous record set. I have my subreport in the page header (tried other places) and I cannot seem to get it right. I have my group footer set to new page after.

Thanks
BB
 
The page header is an inappropriate place for the subreport, right click the Report Header and select insert section below, and place it in there.

Then you can suppress the entire main report based on the subreport.

If you want a single set of data, such as a group suppressed, then place a group in the main report, and in the group header place the subreport, and then all of the details for that group will be suppressed.

If this doesn;t resolve, try posting:

Main Report layout
Example data
Expected output

Stating that a page needs to be suppressed isn't very meaningful, I could show you how to insert a blank page, and then suppress it, obviously you don't want a page suppressed for the sake of it being a page, you want some set of data suppressed, so explain accordingly.

-k

-k
 
Thanks K

I am basically trying to create a monthly statement to mail to clients showing accounting transactions, but there is no need to print ones with a zero or less balance due.

My Layout is as follows:

PH
GH - this is where I will put client name and mailing info
D - Shows transactions in the last full month
GF - Shows Prior Balance from subreport, current balance (summary of detail) and Balance Due from subreport

Each client would get their own page and the grouping is on client name and the subreports are linked to the client name.

Tnanks
BB
 
Where are you placing the subreport?

The subreport should be in a group header section PRIOR to anything being displayed, so right click the group header and select insert section below, palce the group header fields that you're displaying (if any) in the lower group header, and the subreport in the upper (Group Header A).

Now you can conditionally suppress all sections after the Group Header A based on the subreport shared variable value.

-k

 
I added a section into the Group header giving me 1a and 1b. I put the subreport in 1a and suppressed 1b but 1a still prints with the amount from the subreport. Is there a way to stop that from printing?

Thanks
BB
 
You want to suppress all sections in the subreport.

In the main report, you want to make the subreport as thin as possible along with the section (1a) the subreport resides. You might also want to format section GH 1A to underlay following sections

That should get rid of a lot of white space left.

-LW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top