all groups > sql server reporting services > october 2007 >
You're in the

sql server reporting services

group:

Setting a dynamic Title tied to the parameters


Setting a dynamic Title tied to the parameters Candyman
10/19/2007 4:45:04 PM
sql server reporting services:
I have a report that ties to a subreport. I can pass many parameters to that
subreport template and retrieve the results. I can change the titling in
the sub report on what parameters are passed (if one parameter value is
passed).

I created a dataset based off the parameters then simply called that field
from in the function of the title and it worked great.
Rpt_Type dataset:
Select
case
when @Filter = 'A' then 'Approval Recommended Status'
when @Filter = 'AB' then 'Booked Approval Recommended Status'
when @Filter = 'AP' then 'Pipeline Approval Recommended Status'
end Rpt_Type

Title formula: = First(Fields!Rpt_Type.Value, "Rpt_Type")

*******************************************
now I have two variable parameters and I need to retrieve
theory
Set @prodCode =(1,2)
if prodCode in @prodCode and @Filter = 'AB' then. . .

The trouble is that RS will not accept the Parameter if it is set for more
than one variable.
Please Help
Re: Setting a dynamic Title tied to the parameters EMartinez
10/20/2007 3:01:16 AM
On Oct 19, 6:45 pm, Candyman <Candy...@discussions.microsoft.com>
[quoted text, click to view]


If I'm understanding your scenario correctly, you will either want to
load the values in @prodCode into a table or string array where
possible. Or, if you expect only 2 values you could use something
like:
if (prodCode = max(@prodCode) or prodCode = min(@prodCode)) and
@Filter = 'AB' then. . .
Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
Re: Setting a dynamic Title tied to the parameters Candyman
10/25/2007 5:34:02 PM
Close, but that only pulled one value to compare. I did figure it out.

To create a variable title in a linked subreport. In this sample I will use
Rpt_Type as my varible title :

Create Dataset for the title with case statements. These may include complex
statements:

Rpt_Type:
Select
case
when charindex('AB,',@Filter)>=1 then 'Cond 1'
when charindex('AP,',@Filter)>=1 then 'Cond 2'
when charindex('A,',@Filter)>=1 then 'Cond 3'
end Rpt_Type


Place a JUNK parameter at the end of the parameter string passed to the
subreport from the main report. This forces @Filter to see the comma at the
end of the last good entry.
ab,a, JUNK

Use the comma in the search string 'A,' will result in 'Cond 3'

After that call the value of the Rpt_Type into the title. Works like a charm.

[quoted text, click to view]
Re: Setting a dynamic Title tied to the parameters EMartinez
10/27/2007 10:42:27 PM
On Oct 25, 7:34 pm, Candyman <Candy...@discussions.microsoft.com>
[quoted text, click to view]


I'm glad you figured it out. Good information to share.

Regards,

Enrique Martinez
Sr. Software Consultant
AddThis Social Bookmark Button