February 12, 2008 at 8:05 am
Hi,
I have a problem where I want to use unnamed parameters in a DB2 odbc connection. I have the same parameter that I want to use in multiple where clauses, but I don't want to have to enter the same value multiple times. Is there a way to have reporting services only request the value one time?
Thanks in advance,
Jimmy
March 6, 2008 at 11:09 am
Hi,
Not sure if this is related but I had an issue using DB2 and unnamed parameters with SSRS.
With trial and error I found out the following:
Put a ? in place of every usually named parameter e.g.
Select * from SCRATCH.PROD_KPI_REPORT_DATA KPI
WHERE
(KPI.PRODUCT =? or ? = 'ALL')
and
(KPI.CHANNEL = ? or ? = 'ALL')
for read only with ur;
Then set up the parameters in REPORT PARAMETERS and throwing away the default entries created that you don't want, i.e. I had 4 Parameter1, Parameter2 etc.
Then back in the dataset, select ... and move to the PARAMETERS tab.
Every ? used appears, I had 4 for example.
Now simply use the drop down to assign your named parameters created in REPORT PARAMETERS. In my example the first 2 ? were assigned to my first named parameter and the second 2 ? to my second named parameter.
Just have to make sure your named parameters are matched to the correct ? order.
March 7, 2008 at 1:32 am
Hello,
The previous answer is correct for as far as i understand the answer.
The unnamed paramaters will be added to the report parameters in the sequence of first come in the query. Then you go to the report paramaters and you give the parameters a usable name and when needed the default value etc.
When you have done that you go back to your dataset and go the the tab for paramaters and map the ? with the parameter names you just adjusted. When you want to use the same parameter for the ? just use the same Parameter@ThisOn.value again.
If you have any more questions just let me know.
Niels Naglé
Info Support
October 8, 2010 at 7:28 am
Can you please elborate Parameter@ThisOn.value with example. I would greatly appreciate....
Thanks
Andy
October 11, 2012 at 10:00 am
I am not sure.. need to try this..
I think you can hide the extra parameters displaying. and assing the values to to the hidden parameters as the one which is unhidden.
Let me know if it works.. I cannot try this now as my machine has got crashed.
Regards,
Mahendra Jain
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply