Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 textbox as a param

Author  Topic 

nejibg
Starting Member

3 Posts

Posted - 2008-10-01 : 07:14:55
Hi All

One of my report parameters allows users to select a list of countries from a dropdown list, and I'd like to pass the selected countries to one of sql functions in my query.

I created a textbox to hold a list of the selected countries this way: =split(parameters!Countries.Value,",")

How can I refer to the values stored in the textbox (txtCountries)in my query?



Part of my query is:

select * from table1

where fn_FindStringInString(FullNameCountries,txtCountries.Text ) ='TRUE'



Query is erroring on txtCountries.Text.



How can I reference txtCountries.Text in my query, or how can I refer to the values selected by the user. My function expects a comma delimited string as a parameter.

Thanks for your help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-01 : 07:41:54
just use varchar parameter in code behind and use Parameter!yourparameter.value. it will automatically send a csv list when you multiselect values to backend.
Go to Top of Page

nejibg
Starting Member

3 Posts

Posted - 2008-10-01 : 08:22:40
Thanks for your reply.
I tried
where fn_FindStringInString(FullNameCountries,Parameters!@countries.value) ='TRUE' and it gave me error: incorrect syntax near '!'
also tried
fn_FindStringInString(FullNameCountries,=Parameters!@countries.value) ='TRUE' and it gave me error: incorrect syntax near '='
countries is the name of my param, also I tried without @ symbol and got the same errors.
Alos tried Parameters!txtCountries.Text and got similar error.
Any more suggestions? thanks in advance.
Go to Top of Page
   

- Advertisement -