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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress detail depending on value in sub report

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CRW10

I have a simple report containing bank accounts at the detail level - one row for each account. I have to bring in the balance via a sub report linked by account id .

In the sub report i also have a calculation flag showing the no of days since last balance import eg -1,-2 -3 days etc

I want the main report to suppress all data except when the flag in subreport is -7 (or lower, ie worse than 1 week). But on conditional supression I cannit view the sub report fields - how can i do this please
 
Place the sub in a detail_a section, with your main report fields in detail_b. Then set up a formula and place it in the subreport report footer:

whileprintingrecords;
shared numbervar bal;
shared numbervar flag := <yourflaghere>;
if flag <= -7 then
bal := <yourbalancehere>;

In the main report, use a formula like this to show the balance in detail_b:

whileprintingrecords;
shared numbervar bal;

In the main report section expert->detail_b->suppress->x+2 enter:

whileprintingrecords;
shared numbervar flag;
flag > -7

Suppress all sections within the subreport, format the subreport (format subreport->subreport tab->check "suppress blank subreport", and also format the detail_a section to "suppress blank section". This will cause detail_a to disappear, but allow the shared variables to pass. You cannot suppress the subreport itself or the section directly.

You should also add a reset formula in a suppressed detail_c section:

whileprintingrecords;
shared numbervar bal := 0;
shared numbervar flag := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top