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!

Record Selection & Subreports

Status
Not open for further replies.

Stroeve

Programmer
Jun 20, 2001
8
0
0
US
I have created a CR6 report with several subreports.
In the main report I use the following record selection:
{PROBLEMS.ORGANIZATION_ID} in ["20000082", "20000081", "10000011"]

All the subreports are linked with this field called PROBLEMS.ORGANIZATION_ID to the exact same field in each subreport.
Within each subreport I again made a record selection, which now look like: {PROBLEMS.ORGANIZATION_ID} = {?Pm-PROBLEMS.ORGANIZATION_ID}

I expected the subreports to show the data for all three oganization_id's, but unfortunately is does not (it shows records though).

Could anyone help me out here?

 
Try changing :
{PROBLEMS.ORGANIZATION_ID} = {?Pm-PROBLEMS.ORGANIZATION_ID}
to:
{PROBLEMS.ORGANIZATION_ID} IN {?Pm-PROBLEMS.ORGANIZATION_ID}
 
Thanks for you reaction.
I tried this, but it didn't work.
 
Which records are being displayed? All of them?
In which section is your sub report? Details?
 
Which records are being displayed? All of them?
ANSWER: No just the records where PROBLEMS.ORGANIZATION_ID="20000081".

In which section is your sub report? Details?
ANSWER: In a Report Footer.
 
I created a sample report similar to yours, and this is what I found:

If your subreport is in the Details section, the correct data will be shown. If your subreport is in the report footer section, only the subreport data that corresponds to the last organization_id shown on your report will be displayed. This is because your subreport is linked to your report.

I did this, and it worked:

I created a parameter on the main report, allowing multiple values. Then, I linked the sub report to this parameter, using the appropriate field. Then I changed {PROBLEMS.ORGANIZATION_ID} = {?Pm-PROBLEMS.ORGANIZATION_ID}
to:
{PROBLEMS.ORGANIZATION_ID} IN {?Pm-PROBLEMS.ORGANIZATION_ID}

When you preview the report, choose all three values for organization_id when you're prompted for parameters.

The correct data will be displayed in the report footer.

Let me know if you have any problems...
 
Thanks again for your help.
You wrote: "If your subreport is in the Details section, the correct data will be shown."
This is definitely a useful suggestion. Maybe a stupid question, but how can I prevent my subreports to be printed a zilion times?

You wrote: "I created a parameter on the main report, allowing multiple values."
This would probably be a CR7 or CR8 feature. I haven't seen it yet in CR6.

 
When I *said* that dropping your sub reports in the Details section showed the correct data, I meant that it would show something like this:

20000082
-records for 20000082 only
20000081
-records for 20000081 only
10000011
-records for 10000011 only

but I assume that this is not what you want.

And I've never worked with CR6, but I've read articles on Seagate's web site that indicated how to work with multiple-value parameters with version 5, 6 and 7, such as article id# c2006803 ("Linking subreport to main report on a multiple-value parameter") at:

I think that it will solve your problem.

HTH!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top