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

Easy way to send data from main report to a subreport?

Status
Not open for further replies.

mdieckman

MIS
Nov 21, 2006
88
US
I am sure this is probably very novice, but I am having difficulty with it. I have a main report that it searching for a specific set of members. Then in the subreport, I want to take those membership numbers in the main report and search only those numbers in the subreport. What is the easiest way to do this?

I am using Crystal reports 8.5.

lets say that my field is member.memid

Can I somehow create a link with a subreport or a parameter that matches between the main and subreport or even possibly a global or shared variable?

Any help is much appreciated.
 
Alright, I did some searching and I found shared variables and I am trying to use that. However, the shared variable I am using only returns the last variable in the list of membership ids. Is there any way to get around that or possibly an easier way to do this?
 
Where is the subreport located? Please explain a little more what you are trying to do with the report overall.

If you grouped on the field that you are selecting (in the record selection formula) in the main report, placed the subreport in a group section, and then linked the subreport on that field, only matches would appear.

-LB
 
Here is what I have been trying with no luck so far:

First, I tried declaring a shared variable in my main report like so:

shared stringvar x = {member.memid};

I stored this in a formula field.

Second, in the subreport ( where I want to search only those member ids from the main report), I also created a formula field declaring the shared variable.

I inserted it into the report and I noticed it only returns the last membership #.

Then I tried closing this out, and I tried to insert a subreport below the main report using the insert tool. I imported my 2nd report (the report I'm trying to use as a subreport. I liked the memberid field using the link tab, but again this only returns the last memberid # in the subreport. I hope that makes sense.

 
Thanks for you previous reply. I was able to figure it out based on what you posted here:

"If you grouped on the field that you are selecting (in the record selection formula) in the main report, placed the subreport in a group section, and then linked the subreport on that field, only matches would appear."

I did exactly what you suggested and it worked. :) I was trying to make it way more complicated than it actually was.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top