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!

Passing Arrays from formula fields

Status
Not open for further replies.

davew123

Programmer
Feb 14, 2005
7
0
0
GB
I have a report with a subreport which both need to select on some data. For example

not {table.field} in ["001a","002b"]

I want to avoid duplication of data within the reports and so would like to store the data in a formula field and pass the data down to the subreport.

For example:

in main report
not {table.field} in [{@ff_exclude_list}]

in subreport
not {table.field} in [{?p_exclude_list}]

I can't get this to work. How would this data be passed from a formula field when you can't have array results?

Thanks
 
You could either use the same record selection criteria in both main and subreports:

not({table.field} in ["001a","002b"])

Or, if you are using a parameter to exclude values, then you would add the following to both record selection formulas:

not({table.field} in {?excludedvals})

Then in the main report you would go to edit subreport links and add {?excludedvals} from the main report as a linking field, and use the dropdown box on the bottom left to select {?excludedvals} (NOT {?pm-?excludedvals}).

-LB
 
Thanks for the help lbass.

As the data I am using is going to remain relatively static I may not want to have if as in input parameter.

How could I replace the parameter entry in your example

not({table.field} in {?excludedvals})

with a formula field which held the values? (eg not({table.field} in {@excludedvals}). How would the values be formatted in the formula field?

Hope that makes sense. Ta.
 
I think you are hoping to use a shared variable in the record selection formula of the subreport, and I don't think you can do that. To use a formula in both places will still require that you create the formula in both places, which is why it is probably just as simple to bypass the formula idea and copy your record selection formula from the main report into the record selection formula of the subreport.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top