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!

Suppressing Entire Sections?

Status
Not open for further replies.

Wease7

Programmer
Aug 29, 2003
13
US
Currently, I can get the report to suppress the section if there are no records to display, however, the detail lines (which are what I am trying to supress) are still showing up. Meaning the placeholders for the blank sections are still there and they are thowing off the formatting of my report. I want them supressed, but I also do want want the blank detail lines to show as well. Can anyone help me?
 
If there are no records, no detail sections would ever show.

Please explain again after carefully checking what section is showing because what you are saying seem to contradict this.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
In Crystal 8.5, right-click and choose [Format Section]. Then choose the formula next to [Suppress].

If you are already doing this and it is failing, please post the formula.

Madawc Williams
East Anglia, Great Britain
 
I didn't explain it very well. Let me rephrase:

I have a report with 8 subreports. I have a driver stored procedure that gets all the records those subreports will need. The first 3 subreports are summary reports, they use all records that the driver proc brings back. They calculate dollar and case summaries (I work for a medical management company) and bring them back in one report, esentially one record. The next 5 subreports make up the detail cases of this report. However, not all of the cases that the driver proc pulls back are used. Some of them are not used by the subreports because they might fall out of the date range of the user entered date period. They were pulled in the first place because they are part of the user entered Year To Date period and that is only used in the first three subreports to show case/dollar summaries.

So if there is a case that doesn't need to be shown, it does not show, but since the driver proc (which drives the whole report and pulls back all cases regardless if they will be used in the last 5 subreports) still has those records, it leaves the placeholder for the detail lines, thus screwing up the formatting. Currently I have 2 or 3 cases per page, depending on if they are the start of a new grouping of cases. But when I have a supressed case, the placeholder for those detail lines shifts things. I have uploaded a screen shot here:


Notice the A, B, and C detail lines that are not being suppressed. I need those to go away and not print, keeping things neat and clean. Now in the Supress Formula for each section within the subreport and each subreport in the main report, I am checking a Supress Formula Field. It looks like this:

isnull(count({drvReportCMActivityDetail;1.CaseDefnID})) or
count({drvReportCMActivityDetail;1.CaseDefnID}) = 0

So if there is no CaseDefnID, supress the section. However, now that I think about it, there IS a CaseDefnID returned, even though the Subreport might not be using it. I might have to query on something else in that Supress formula.

Any ideas? Sorry for the long drawn out response, I wanted it to be clear, unlike my first write up.
 
In Crystal 8.5, 'Suppress subreport' is tricky. The decision to print a section is made before the subreport is processed, so any test based on something the subreport returns will fail. The value is not available until the next section of the main report.

There is a work-round, see
Crystal 9 has a better option, I think, but I use just Crystal 8.5.

Madawc Williams
East Anglia, Great Britain
 
How do I create a Supression Formula in Subreport B that can access data in Subreport A? I need to try this from your other thread and see if it works:

"Subreport B sits on details b and shows transaction details. But details b has a suppress formula, that applies whenever the account number for Subreport A is different from the current account number."

Please show me how to do this. Thanks...
 
Nevermind, I got the whole problem fixed. I ended up adding an indicator to the Driver Stored Procedure on the Main report and then checking to see if it was NULL in my supression formula. If it was, I supressed the subreports successfully. Thanks for the help, everyone... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top