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] "EMartinez" wrote:
> On Oct 19, 6:45 pm, Candyman <Candy...@discussions.microsoft.com>
> wrote:
> > 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
>
>
> 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
>
On Oct 25, 7:34 pm, Candyman <Candy...@discussions.microsoft.com>
[quoted text, click to view] wrote:
> 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.
>
> "EMartinez" wrote:
> > On Oct 19, 6:45 pm, Candyman <Candy...@discussions.microsoft.com>
> > wrote:
> > > 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
>
> > 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
I'm glad you figured it out. Good information to share.
Regards,
Enrique Martinez
Sr. Software Consultant