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

Suppress records in Main Report Based of Results in Subreport

Status
Not open for further replies.

deeya

MIS
Sep 18, 2006
78
GB
Hi All,

CR11 ORACLE DB.

I have a date range parameter in the main report 'Start date' which is passed to my subreport and selects the data accordingly. What I want to do is suppress all the records for group 1 in the main report where the subreport is blank?

Let me know if you need anymore information.

Thanks

Deeya
 
If you put the subreport in the group header, it could return a Shared Variable that would cause the group detail lines to be suppressed.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry can you explain in more detail please?
 
To pass data back from a subreport, use a shared variable. For a date, put a formula field in the subreport like
Code:
Shared dateVar    
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Code:
Shared dateVar 
V_Today := V_Today

If it was a currency value, you'd do it differently, e.g.
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved

The shared variable is only available in the section after the section which contains the subreport. So if you put the subreport in the group header, you could use its results to suppress the group detail lines and group footer. Or even an extra section of group header.

Also consider if there is any way you can do it all in the main report. Much more efficient when it is possible.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top