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

Can I connect a subreport with a field in the main report?

Status
Not open for further replies.

pokerace

Technical User
May 24, 2005
118
US
Ok, this is a tough one. I have a report that prints out a list of clients grouped by their case manager. For the database I am using, the field that contains the 'name of the case manager' is the same field that contains the 'name of each service provided', so there is no way for me to group by case manager with the services provided listed for each client. For example, if Jane Smith is case managed by 'A' and is enrolled in services 'X', 'Y', and 'Z' then there is no way for me to group by 'A' and then list Jane Smith's services because they are part of the same field that 'A' is in and have been eliminated when 'A' is grouped. Does that make sense? The reason I can't group it by client name is because the are lots and lots or names and a good number of case managers, so that would take a long time.

I was thinking that I could accomplish what I want by inserting a subreport. After the information has been grouped by 'case manager' and then by 'client name', can I insert a subreport that referes back to the 'client name' of the grouped client outside of the subreport and not use it's own criteria for the name? I want the subreport to say something like: 'look at the 'client name' that is in this section of the main report and then list all of the 'services' that are associated with that name.

If that would work then I could get rid of any duplication by hiding some of the info.

Thanks to anyone who takes a stab at this!
 
Please post technical information, your description is helpful, but technical information is key:

Crystal version
Database/connectivity used
Example data
Expected output

Yuo speak of fields, but not the table(s), nor the relationships except to say that you cannot join them, yet somehow a subreport can join them...

Perhaps you're speaking of a single table, and that's your dilema, if so, you can add a table in a second time, join it accordingly and avoid the performance hit of subreports.

-k
 
Try inserting a group on case manager and then one on client. Then insert a subreport in a client group header_b section, and link it to the main report on client name (a client ID field would be better) only. This should give you the services regardless of the case manager involved per activity.

-LB
 
Crystal 10
Database: Consumer ODBC

synapsevampire:
Yes, I am mainly speaking of using data in the same table and field. Since I am first grouping specific data in that field, I can not place more data under each grouping from that same field because it's already been eliminated by the criteria used for the first grouping. Does that make better sense?

I did not realize that I could add a table in a second time? When I saw that you could only move over a field once, I didn't think of trying to add the same table twice. If that works then thanks.

lbass:
How would I link a subreport to the client name in the main report. Is that something I need to enter into the formula or can I do it through the gui like linking fields?
 
What formula? I assumed that client name was a field, but let's say it is a formula like:

{table.lastname}+", "+{table.firstname}

You would create the identical formula in the subreport, and after you add your fields to the subreport and click on finish, you will see a tab for linking. In the linking tab, choose {@name} as your main report field to link to the subreport. The corresponding formula should appear in the lower right box as the subreport field to link to. If it doesn't, use the dropdown to find it in the list. Then place the subreport in the {@name} group header_b section.

-LB
 
OK, a simple google search has showed me how to link the subreport. Thanks for the help. Can't wait to see if this works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top