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!

Linking a table to a shared variable. Possible?

Status
Not open for further replies.

ImArchimedes

Technical User
Sep 25, 2007
62
So, I have a field in a table that is a number of values concatenated together, delimited with "!"'s. These values are actually school ids. At the beginning of my report, I have a formula that takes that field and pulls out the individual ids and drops them in their own shared variables.

At this point, I've created these shared variables and each equals a different school's id. I have a school table in the report that has a school_ID field and the school variables I created are going to equal some of my School_IDs. I want to link the School table to these vars I've created.

Is this possible? Anyone have a different approach? My end goal is to pull in the actual names of the schools which are only found in the school table so I have to link to the school table some how.

... my brain hurts...
 
UPDATE:

I think I actually almost had it but hit a road block. I'm doing the school stuff in it's own sub report and I have a selection formula that for the sub that looks like this:

global stringvar school1;
global stringvar school2;
global stringvar school3;
global stringvar school4;
global stringvar school5;
global stringvar school6;
global stringvar school7;
global stringvar school8;

{Trip_1.trip_id} = {?Pm-Trip.trip_id}
and
(
({School_1.school}=school1)
or
({School_1.school}=school2)
or
({School_1.school}=school3)
or
({School_1.school}=school4)
or
({School_1.school}=school5)
or
({School_1.school}=school6)
or
({School_1.school}=school7)
or
({School_1.school}=school8)
)

In the sub, I have the trip table and the school table but, they are currently unlinked since, after all, the school IDs are not in the trip table.

So, I ran the report and it works! Sort of...

The first school on the trip gets it's name pulled in but, I think because the tables are actually no linked, the detail band doesn't run through multiple times for all my schools. Only once so I only get one school name.

Any thoughts? If this doesn't make any sense, I understand.
 
If i understand correctly here is my suggetion:


In the Main report if you can create a group based on that formula that is breaking the School ID's then place the subreport in the footer .

and in the subreport "Change subreport links" pick the formula on the main report side and link it to the school id in the subreport.

Hope you can understand and this helps.
 
I think you will have to add a separate subreport for each school, with a sub linked to the main report formula for each school.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top