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!

Subreport Linking - How to Produce A Subreport on All Selected Data

Status
Not open for further replies.

ihda

MIS
Apr 6, 2001
46
US
Crystal 8.5

1. I have a Container report which has no groups. It distinct counts a loan number based on the selection criteria and displays the total number of loans at the end of the report.

2. I want to execute a subreport that links on the loan number and displays loan number count by city.

3. Problem: The subreport operates on the one loan number in the link - not on all the records selected in the container report.

Example of what I need:

Container report: 100 total loans

Subreport: Joliet: 20 loans
Chicago: 70 loans
Springfield: 10 loans

Currently, the subreport counts 1 loan - and displays that city based on the loan number link.

A cross-tab report is not a workable solution. The above is an example. I may have thousands of cities on the breakdown. Also, the user may not want to see a breakdown of this kind. The user may want to see a breakdown based on other criteria reported in another subreport.

The container report cannot have groups. The selection criteria on the report, based on answers to prompts, would need to produce different groups based on the answers provided to the prompts because there is no hierarchy to the data

Is it possible for Crystal 8.5 to do the above?

Is it possible for Crystal 8.5 to pass the selection criteria to the subreport?

Would one of the other Crystal products provide me with the above?

Thank you
 
I think your looking at the report from the wrong direction. I don't think you really want to link with the loan number. What you need your subreport to do is select the same set as in the main report, including the city.

It probably would make more sense to have the city in your main report and do distinct counts for each city and then a distinct count overall (which can be placed before the actual cities).

The other alternative is to create an array of loan numbers in the main report and pass that to the subreport.

Lisa
 
Thank you for your reply.

This is the first array I've written in Crystal and I'm not sure I've written it correctly. May I impose on you and ask you to check it?

When I execute the subreport I link to the array. I'm still seeing only one city. In the report footer section, I see the city for the last loannumber. In the detail section, I see the city for that loannumber.

Array Logic:

EvaluateAfter ({#RTotal0})
'Count the loannumber

Dim MyName, xx

MyName = Array ({z_ihda_loan_lds.LoanNumber})


redim preserve myname({#RTotal0})

MyName({#RTotal0})={z_ihda_loan_lds.LoanNumber}

xx = myname({#RTotal0})

formula = xx


 
I take back what I said. Crystal won't let you make the output of a formula to = an array, so there would be no way to pass it to be used in the selection formula of the subreport. An array won't do it, you will have to use one of the other two methods.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top