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

Omit page based on data in subreport

Status
Not open for further replies.

clevelandjwb

Programmer
May 18, 2004
28
0
0
US
I have a report that uses a subreport to summarize data which appears in the report. The data being reported on is account data and the subreport summarizes balances for certain subaccounts within a major account.

In the main part of the report, each subaccount appears with its beginning balance, activity, and ending balance. If it has no activity, it does not appear in this section.

In the subreport that comes at the end each subaccount balance that is non-zero appears. There is one exception, if the subaccount number is = "001" it appears even if the balance is zero. At the moment, all of this works.

What I would like to do is to suppress all statements where the only thing printing is a subreport with exactly one line that indicates the balance of subaccount 001 is $0.00. I think that this section could be suppressed if I were able to count the number of lines in the subreport and found it equal to 1 at the same time the sum of the balances in the subreport was $0.00. In this case, there would be no detail lines in the report but I would need to be able to accumulate a count and subtotal from the subreport to use to suppress that section and I don't know how to do that.

Any ideas would be appreciated.

John

 
In the main part of the report, each subaccount appears with its beginning balance, activity, and ending balance. If it has no activity, it does not appear in this section."

What section is that? Please be specific.

You speak of sections but not what the section is, or if it's a group, or if it's linked, or...

It's generally best to post technical information, then you can add text descriptions:

Crystal version
Database/connectivity used
Example data
Expected output

You can pass shared variables between subreports and the main report (or other subreports) providing the subreport is executed in a section PRIOR to the shared variable being used in the main report.

-k
 
I have been away from this project for a while but finally am back. I probably didn't do a very good job of describing it because I am familiar with what all these words mean in this context and no one else trying to help me would have that understanding.

To start Crystal 8.5 using SQL data. The work of extracting data is done by a stored procedure that is run separately and produces a table that only needs to be read by Crystal.

I used the word section in its non-Crystal sense, that is to mean "a portion of".

In the Crystal sense, there would be a page header, (a group header, detail, a group footer) possible repeated several times followed by a subreport that would summarize data that is contained in the group footer(s).

The stored procedure produces a record for every possible group even if it has no detail. All records contain the beginning and ending balance which is what goes into the group headers and footers. If there were no actual detail records, there will be one record produced with the beginning and ending balance and a flag that indicates the detail is NOT to be printed. Testing for that flag at the detail level allows suppression not only of the detail record but also the associated headers and footers.

Having put some thought into what you said I think I can change the question to a much more simpler one. I assume the whole subreport can be suppressed if an appropriate variable can be initialized prior to the calling of the subreport and tested upon return. This would assume that the section (subreport) could be suppressed essentially after it was formatted using the suppression formula in the "format section" screen.

So what I am basically asking is can I set a global variable prior to the execution of the subreport and modify that variable in the subreport?

Hope this makes a little more sense although it is much longer than I would like to burden you with.

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top