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

report selection based on subreport criteria

Status
Not open for further replies.

dchard

IS-IT--Management
Oct 9, 2002
17
US
Crystal 8.5 accessing Pervasive db via odbc connection
I have a main report and several subreports that are linked to the main report.
The main report is grouped by order number (subreports are details1, b, c, d, e, f, g)
There is a date field subreport c.
If that date field is not within a certain range, I would like the entire group record and all subsequent detail records that consist of subreports to NOT print. IE I am trying to make report selection criteria based on data in subreport. Is there any way to do this.

Thanks

Deb Chard
ILX Lightwave
 
You have your report improperly designed.

Place the subreport in the 2nd section of the group, shrink it down to a teeeeeny lil size, then use a shared variable from it to drive suppression throughout the group:

The first section will have th following formula:

whileprintingrecords;
Global booleanvar Suppressall:=False

The subreport will have:

whileprintingrecords;
Global booleanvar Suppressall;
if {table.date} <> currentdate to currentdate+1 then
Suppressall:= true

Now all subsequent sections can use the following for their section suppression:

whileprintingrecords;
Global booleanvar Suppressall

But I'm guessing that you're better off to redesign the report to use the subreport as the main report... In general subreports are evuuuuuhl, slow creatures, and should be avoided.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top