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

Pass data to a subreport from main report

Status
Not open for further replies.

huytonscouser

Programmer
Oct 14, 2011
88
US
I have a report that produces differences between today and yesterday, and looks like this, just 3 fields.

Array Alias Growth Array serial#


Phx_t1_0343 1004.00 000192600343
phx_t2_2489 6144.00 000192602894

I want to use the values for "array name" as a selection criteria for a following
sub-report.

As a test i created a formula which created a shared variable :-

shared stringvar testname := "phx_t1_0343";

and placed in report header.


In the subreport, i created a formula :-

shared stringvar testname;

and placed in subreport report header.


It works fine, and displays "phx_t1_0343"


So i thought i would be able in the record selection of the sub-report
to specify :-
{SRMARRAY.ARRAYALIAS} = {?testname}

but i do not see the formula ?testname


Is this normal ? is there a better way to pass the "array names" to the subreport ?

Thanks in advance
 
You are not using terms consistently. {?testname} would be a parameter, not a formula. You also can't use shared variables in selection formulas. You could just link on the array alias field--if you group on it in the main report and place your sub in a group section. This assumes you plan to select multiple array aliases.

Another option is to create the parameter in both main and sub reports and to link them together, using the parameter in selection formulas in both reports. Not sure what your overall layout is, which is why it is hard to determine the appropriate approach.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top