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

problem passing data from sub to suppress group

Status
Not open for further replies.

GCL2007

IS-IT--Management
Dec 11, 2007
167
US
I have a report where I have a subreport in GH1. Subreport is transaction list for a particular item where I get the min of transaction date and max of transaction date. I want to calculate the difference and pass it along to the main report. In the sub I have a formula
Shared numberVar daysdiff := {@diffminmax};
@Diffminmax is a formula
Maximum ({TABLE.TRANSDATE})-Minimum({TABLE.TRANSDATE})

In my main report I have a formula
Shared numberVar daysdiff;

The subreport is in GH1, I have other fields in Detail line of main report. I want to suppress both the GH1 section and the DETAIL section of the main report if the value passed from the subreport is less than say 25 days. I can pass the variable fine but I can't seem to suppress the sections based on the value i'm passing... any thoughts?
 
Shared variables can only be used in sections below the section that uses them. One work-round is to have a small section with the subreport and then a larger section with the details. But this won't work for the header, I don't think that is possible.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Place the sub in GH1a. Suppress all sections within the sub, remove the borders, format the sub to "suppress blank subreport" (on the sub tab), and then format GH1a to "suppress blank section". Then you should be able to go into the section expert->GH1b (and then details)->suppresss->x+2 and enter:

whileprintingrecords;
Shared numberVar daysdiff;
daysdiff < 25 //Or you could use a number parameter {?NoOfDays}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top