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!

how to pass values of array from main to subreport

Status
Not open for further replies.

JC4abi

Technical User
Oct 29, 2005
3
US
hello,
I am using CR v10..
I have some data on the main report that I want to capture
conditionally based on a FR% < 93 into a string array.
I want to pass/share them in my subreport as input values for record selection.

main Report data...

FR%,region,date
94,NA,10/20/2005
92,EDC,10/20/2005
89,NA,10/21/2005
93,EDC,10/21/2005.. etc

concat values with delimitor to pass/share in subreport..
myStrArr[0]:="92:EDC:10/20/2005"
myStrArr[1]:="89:EDC:10/21/2005"... etc

How do I split them back out as individual data for use
in the subreport as input values for record selection.

Any help would be appriciated...Thanks





 
Can you explain why you cannot just link the subreport to the main report on FR% and then either use a record selection formula in the subreport of:

{table.FR%} < 93

...or use a formula in the main report to conditionally suppress the section the subreport is ine when it doesn't meet this criterion?

-LB
 
Hello Ibass,

Thanks for answering back...

I made a mistake in my submitted question..
When FR% is less than 93% the values I want to save and pass to subreport are "region","date" and "division" instead of "FR%".

FR% is a formula field that computes grouped data and is not available to select in subreport.

The main report and subreport are same. The difference is that main report is showing charts and summary grouped data
based on all data in the table and subreport want to show raw data where FR% < 93 and "FR_DaysLate" is negative value.

Currently I have to manage subreport records selection manually like below...
if {ZMM00108_Query.division} in [91.00]and {ZMM00108_Query.FR_DaysLate} like "*-"
then
(
if {ZMM00108_Query.PGI Date} in [date("8/5/2005")]
then {@RegionCode} in ["NA","EDC","AU"]
else if ({ZMM00108_Query.PGI Date} in [date("8/4/2005")])
then {@RegionCode} in ["AU"]
else if ({ZMM00108_Query.PGI Date} in [date("8/3/2005")])
then {@RegionCode} in ["AU","NA"]
else if ({ZMM00108_Query.PGI Date} in [date("8/2/2005")])
then {@RegionCode} in ["AU","EDC"]
else if ({ZMM00108_Query.PGI Date} in [date("8/1/2005")])
then {@RegionCode} in ["AU"]
)
else if {ZMM00108_Query.division} in [92.00]and {ZMM00108_Query.FR_DaysLate} like "*-"
then (
if {ZMM00108_Query.PGI Date} in [date("8/5/2005")]
then {@RegionCode} in ["NA","EDC","JP"]
else if ({ZMM00108_Query.PGI Date} in [date("8/4/2005")])
then {@RegionCode} in ["AU","NA"]
else if ({ZMM00108_Query.PGI Date} in [date("8/3/2005")])
then {@RegionCode} in ["NA"]
else if ({ZMM00108_Query.PGI Date} in [date("8/2/2005")])
then {@RegionCode} in ["AU","EDC"]
else if ({ZMM00108_Query.PGI Date} in [date("8/1/2005")])
then {@RegionCode} in ["EDC"]
)



 
Why not use subreport links on region, date, and division, and then conditionally suppress the subreport when FR% is greater than 93 or when the days late value is not negative?

If for some reason this approach doesn't work, then you should explain the group structure of your main report, show the contents of your FR% calculation and your days late formula, and indicate where the subreport is located and how you currently have it linked.

-LB
 
Hello LBass,
I can not conditional suppress it because FR% is not visible to select in Record Selection Panel and if I type it in Editor manually I got field name is not known...

FR% formula:
if (Count ({ZMM00108_Query.PGI Date}, {ZMM00108_Query.PGI Date}, "daily")<>0 or Sum ({@FRmiss}, {ZMM00108_Query.PGI Date}, "daily")<> 0)
then 100*(1-(Sum ({@FRmiss}, {ZMM00108_Query.PGI Date}, "daily")/Count ({ZMM00108_Query.PGI Date}, {ZMM00108_Query.PGI Date}, "daily")))
else 100;

FRmiss formula:
(if ToNumber ({ZMM00108_Query.FR_DaysLate}) <0
then 1
else 0;

"FR_DaysLate" is a data field from table..
 
I didn't mean for you to use it in the record selection area. If your subreport is in a group section by itself, e.g., GH_b, you can go into the section expert->GH_b->suppress->x+2 and use your formula there to conditionally suppress the entire section. Or, if it is in the same section as data you want to show, you can right click on the subreport->format subreport->common->suppress->x+2 and enter the formula there.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top