venanciop
asked on
How to add a default value Non-queried Paramter
Hi There...I'd like to add a defaut value to a non-queried parameter in Reporting Services 2005.
why that?
When the report opens I'd like to have this default value matched, so the user can run it without change report parameters or if needed change to a different value.
My Default non-queried values today are:
Yes -->Yes
No--> No
All--> <blank>
why that?
When the report opens I'd like to have this default value matched, so the user can run it without change report parameters or if needed change to a different value.
My Default non-queried values today are:
Yes -->Yes
No--> No
All--> <blank>
Just go to the parameter properties and on the bottom right side click the radio button and then add you default data
Create a report parameter and define a default value for it (include All - Null)
Then in the Dataset definition use the parameter (@regestado):
SELECT regid, regdescripcion, regcompania, regfechainicio, regfechafin, regtipo, regvalor, regestado, regwhere, regDestino
FROM bonreglas
WHERE (regestado = @Estado) OR
(@estado IS NULL)
report-parameter-1.png
report-parameter-2.png
report-parameter-3.png
Then in the Dataset definition use the parameter (@regestado):
SELECT regid, regdescripcion, regcompania, regfechainicio, regfechafin, regtipo, regvalor, regestado, regwhere, regDestino
FROM bonreglas
WHERE (regestado = @Estado) OR
(@estado IS NULL)
report-parameter-1.png
report-parameter-2.png
report-parameter-3.png
ASKER
This I know. I can choose non-queried and it has a field to add a value.
So what should I add there? I'd like ti to show All as a dafult, remembering my non-queried values are:
Yes -->Yes
No--> No
All--> <blank>
So what should I add there? I'd like ti to show All as a dafult, remembering my non-queried values are:
Yes -->Yes
No--> No
All--> <blank>
For All, replace null for any text (like 'All´)
and in the where:
WHERE (regestado = @Estado) OR
(@estado = 'All')
Then in the Non-queried field write the word All
and in the where:
WHERE (regestado = @Estado) OR
(@estado = 'All')
Then in the Non-queried field write the word All
ASKER
idmedellin,
Today my query is:
IN_POLITiCO_EXP LIKE (case when @PEP = '' theN IN_POLITiCO_EXP else @PEP end)
You mean chaging it to:
IN_POLITiCO_EXP = @PEP or @PEP 'Todos'
gracias,
Felipe
Today my query is:
IN_POLITiCO_EXP LIKE (case when @PEP = '' theN IN_POLITiCO_EXP else @PEP end)
You mean chaging it to:
IN_POLITiCO_EXP = @PEP or @PEP 'Todos'
gracias,
Felipe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry for an syntax error i forget the '='
IN_POLITiCO_EXP = @PEP or @PEP = 'Todos'
IN_POLITiCO_EXP = @PEP or @PEP = 'Todos'
ASKER
Excellent mate