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

Report Record Selection Formula based on multi-value parameter help

Status
Not open for further replies.

RadRodriguez

Programmer
Nov 4, 2005
2
US
Hi all,

I have a sub-report that is passed a string of values from a main report as a parameter. The sub has a function called {@SelectMPs} that splits the string into its components (it's an array delimeted by commas). Each component is a string. I need to pass these strings to the report selection criteria.

I can get the process to work when I pass only one value to the Report Selection formula like: Right({Plan_.Plan Code},8) = [{@SelectMPs}]. However, the report needs to have multiple values in the {@SelectMPs} formula.

I have tried every way to build the string, with single quotes, double quotes, adding commas in between members and everytime the report fails to return any records.

I have tried including {@SelectMPs} in the group header and footer but neither makes a difference. I can confirm that the value of {@SelectMPs} is formatted as it should be. I have hard coded the same value into the Report Selection formula and I get the data I expect.

Any suggestions are greatly appreciated!
 
Hi RadRodriguez

I am not certain I understand the problem but I think you might be over complicating this. From my reading of this, you have a comma separated string that is being passed to a sub report to break up the string so you can use the individual components in the record selection in the main report. Assuming I have interpreted the problem correctly, and the comma separated string has commas only without spaces, you could avoid the subreport altogether and use this in the record selection:

{table.field} in (Split({sourcedata}, ','))

where {table.field} represents the database field and {sourcedata} is the comma separated string on which the records are to be selected.

Hope this helps


Cheers
Pete
 
Actually, I don't think my explanation was clear enough but either way I figured out ho to split the array and use its members in the report selection formula (of the sub report).

Thanks anyways!
 
Please explain what you did, if it differed from pmax9999's solution, so that this thread can be helpful to others.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top