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

Conditional Subreport suppression question

Status
Not open for further replies.

dzavad

Programmer
Apr 17, 2000
167
US
Hi,
I have CR10 report with 50 subreports in it. Each subreport located in the same Group1 but in the separate sections. Each Subreport calculates some data and shows total result. I need to be able to show only Top 3 from all of this 50 subreports results and hide the others. How can I do that.
Example of Top 3 Result, each row is the separate subreport(the rest of 50 subs with lower numbers is suppressed):
TOP 3
Delays 36
Emotional Component 24
Incomplete Assessment 17
 
You can't do a sort based on the results of a subreport, so before suggesting anything, I need to know if that is critical. Are you sure you need to be using subreports? Why are you?

-LB
 
Yes it is critical to use subreports because of the data that being filtered in each subreport. There is no other way to do it. Our database is prety much screwdup and I am used to do things that in normal well organized relational database I would never do. But this is another issue.
In short, I have string field called Table.AOC("dat1|data2|data4|datat7") that I need to break down in order to find what I am looking for then do count.
So, in the end I have to find Top3 Table.AOCs.
Each Subreport has count total.
 
You didn't answer my question. Is the sort in descending order critical? Because you will NOT be able to do that with subreports. Even using conditional suppression without a sort, you would have to add the entire report again in the report header, use shared variables and determine the maximum value, and then conditionally suppress the displayed subreports based on the max value--but you wouldn't get a sort.

Since you are using v.10, you might be able to create a command that eliminates the subs by using union statements with different filters in each union section. Then you could do group sorts, etc., to your heart's content. If you are interested in this approach let me know.

-LB
 
Descending order is not critical.
Can you show me this approach?

-DZ
 
First, why are these subs in a group section? Do the 50 subs repeat for separate group instances? Also are the 50 subs in 50 group header sections, e.g., gh_a to gh_ax?

-LB
 
Yes, subs repeat for separate group instances. In Group Header.

-DZ
 
Please try to respond with more complete answers. I'm having trouble visualizing this. D

Do you really mean that there is one sub, but 50 group instances so that is how you arrive at 50 subreports? Or do you mean that there really are 50 subreports repeating for each of N group instances? If the latter is the case, is it just a matter of determining the top3 per each group instance?

-LB
 
Sorry if I wasnt too clearon this.
I have report with 50 subreports repeating for each group1 instance. And I need to show only Top 3 subreports and hide the other 47 subreports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top