Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Thursday, March 22, 2012

Distinct Filter in SQL Reporting Services

Hello All,

I've got a stored proc that I can't change that creates a quite large
dataset and takes in 5 parameters. I need to be able to have each of
the parameters selectable from a drop down box so that as you go
through the list of parameters you restrict the results. I have it
able to load the parameters but I end up with this:

Location-
LONDON
LONDON
LONDON
NEW YORK
NEW YORK
NEW YORK
NEW YORK
TORONTO
TORONTO
...

Any idea how i can filter the list of locations by distinct? from
within SQL Reporting Services. I tried a temp tbl in query analyser
and that works but SQL reporting services doesn't like it.Nevermind, It seemed to work the second time i tried to run the query
in reporting services.

BEGIN

CREATE TABLE #temptbl2
(
EnddateVARCHAR(50),
ProjectNumber VARCHAR(50),
ProjectManager VARCHAR(50),
resourceManager VARCHAR(50),
CostCentreVARCHAR(50),
WorkInProgressFLOAT
)

INSERT INTO #temptbl2
EXECUTE jmpwipreportbasic '09/09/2009'

SELECT DISTINCT costcentre FROM #temptbl2

DROP TABLE #temptbl2

END

Maybe this will help someone else.

Wednesday, March 21, 2012

Disregard some parameters

Hi,

I am building a search Query which takes 7 parameters:

Lets call them @.P1 .. @.P7 (all Int's)

The query is a simple select query like:

SELECT * FROM MyTable WHERE (Field1 = @.P1) AND (Field2 = @.P2) ...

My problem is that if some parameters are -1 they shall be disregarded.

Is there any way to set a parameter to a value meaning "Anything", or do I
have to
remove the criteria from the select clause?

(In the latter case I cannot use a stored procedure, which is what I prefer)

Cheers
GunnarGunnar,

if your columns do not contain NULLs, then you can use

WHERE Field1 BETWEEN COALESCE(NULLIF(@.P1,-1),-2147483648) AND
COALESCE(NULLIF(@.P1,-1),2147483647)

This WHERE clause assumes that the value "-1" is your indication of a
missing parameter. If you use NULL instead of -1, then you can replace
NULLIF(@.P1,-1) with @.P1. It also assumes the int datatype. If the column
is of a different integer datatype (for example bigint), then the
minimum and maximum value need to be adjusted.

If your column do contain NULLs, then you can use

WHERE CASE WHEN @.P1=-1 THEN 1
CASE WHEN Field1=@.P1 THEN 1
ELSE 0 END = 1

But in general, the first approach will perform better.

Hope this helps,
Gert-Jan

Gunnar Liknes wrote:
> Hi,
> I am building a search Query which takes 7 parameters:
> Lets call them @.P1 .. @.P7 (all Int's)
> The query is a simple select query like:
> SELECT * FROM MyTable WHERE (Field1 = @.P1) AND (Field2 = @.P2) ...
> My problem is that if some parameters are -1 they shall be disregarded.
> Is there any way to set a parameter to a value meaning "Anything", or do I
> have to
> remove the criteria from the select clause?
> (In the latter case I cannot use a stored procedure, which is what I prefer)
> Cheers
> Gunnar

--
(Please reply only to the newsgroup)|||Hi,

One way to do the trick is to write:

SELECT * FROM MyTable WHERE ((@.P1 = -1) OR (Field1 = @.P1)) AND ...

If @.P1 is -1, the OR-clause will simply be true for all rows, effectively
ignoring the comparison with Field1.

-Jrgen

"Gunnar Liknes" <g_liknes.Tabortunderscores@.g_lobal-satcom.com> skrev i en
meddelelse news:4110a27d$1@.news.broadpark.no...
> Hi,
> I am building a search Query which takes 7 parameters:
> Lets call them @.P1 .. @.P7 (all Int's)
> The query is a simple select query like:
> SELECT * FROM MyTable WHERE (Field1 = @.P1) AND (Field2 = @.P2) ...
> My problem is that if some parameters are -1 they shall be disregarded.
> Is there any way to set a parameter to a value meaning "Anything", or do I
> have to
> remove the criteria from the select clause?
> (In the latter case I cannot use a stored procedure, which is what I
prefer)
> Cheers
> Gunnar
>|||"Gert-Jan Strik" wrote

> if your columns do not contain NULLs, then you can use
> WHERE Field1 BETWEEN COALESCE(NULLIF(@.P1,-1),-2147483648) AND
> COALESCE(NULLIF(@.P1,-1),2147483647)
> This WHERE clause assumes that the value "-1" is your indication of a
> missing parameter. If you use NULL instead of -1, then you can replace
> NULLIF(@.P1,-1) with @.P1. It also assumes the int datatype. If the column
> is of a different integer datatype (for example bigint), then the
> minimum and maximum value need to be adjusted.
> If your column do contain NULLs, then you can use
> WHERE CASE WHEN @.P1=-1 THEN 1
> CASE WHEN Field1=@.P1 THEN 1
> ELSE 0 END = 1
> But in general, the first approach will perform better.

Thank you both (Gert-Jan and Jrgen) for two excellent working solutions to
my problem. The COALESCE function was interesting. Will it perform better
than the "WHERE ((@.P1 = -1) OR (Field1 = @.P1)) "
approach?

Thanks,
Gunnar|||Gunnar Liknes wrote:
> Thank you both (Gert-Jan and Jrgen) for two excellent working solutions to
> my problem. The COALESCE function was interesting. Will it perform better
> than the "WHERE ((@.P1 = -1) OR (Field1 = @.P1)) "
> approach?
> Thanks,
> Gunnar

Yes, because if the column is indexed, index seeks can be used. The OR
solution needs an index scan.

Gert-Jan
--
(Please reply only to the newsgroup)|||Gunnar Liknes (g_liknes.Tabortunderscores@.g_lobal-satcom.com) writes:
> Thank you both (Gert-Jan and Jrgen) for two excellent working solutions
> to my problem. The COALESCE function was interesting. Will it perform
> better than the "WHERE ((@.P1 = -1) OR (Field1 = @.P1)) " approach?

Permit me to modify Gert-Jan's enthusiasm a little. It may perform better,
but I have not always be successful with it. And if the columns is not
indexed then it not matter much anyway.

The only way to find out is to benchmark.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Gert-Jan Strik" wrote
> Gunnar Liknes wrote:
> > Thank you both (Gert-Jan and Jrgen) for two excellent working solutions
to
> > my problem. The COALESCE function was interesting. Will it perform
better
> > than the "WHERE ((@.P1 = -1) OR (Field1 = @.P1)) "
> > approach?

> Yes, because if the column is indexed, index seeks can be used. The OR
> solution needs an index scan.

Does MS SQL perform complete boolean evaluations? If (@.P1=-1) it should
not have to check if (Field1 = @.P1) because the result of the statement is
already determined.

Gunnar|||Gunnar Liknes (g_liknes.Tabortunderscores@.g_lobal-satcom.com) writes:
> Does MS SQL perform complete boolean evaluations? If (@.P1=-1) it should
> not have to check if (Field1 = @.P1) because the result of the statement is
> already determined.

The answer is that, yes, SQL Server is able to make logical shortcuts,
but that is not applicable here.

When SQL Server builds a query plan for a stored procedure, it builds
the plan for the entire procedure at once, and is thus blind to what
the actual values of variables and parameters at the time of the statement.
It does take in regard the values of parameter to build the plan, but
since it don't know whether parameter changes value in the procedure or
not, SQL Server can choose a plan which would yield the wrong result if
the parameter is changed. Moreover, since the plan is cached, the procedure
might be called with some other values the next time.

Thus if you have:

SELECT *
FROM tbl
WHERE (field1 = @.p1 OR @.p1 IS NULL)
AND (field2 = @.p2 OR @.p2 IS NULL)

It cannot look at @.p1 and say "Hey @.p1 is NULL, I don't have to test
Field1". So it must pick a plan where it accesses field1. No, once it
comes to the statement it could opt to not actually check field1, but
the cost is not the check - the cost is the access. In this case,
the optimizer will most like to scan the table from left to right.

Here is another example:

SELECT *
FROM tbl
WHERE @.p1 = 0 OR EXISTS (SELECT *
FROM tbl2
WHERE tbl.col = tbl2.col)

Here, if @.p1 is 0 we retrieve all rows from tbl, but if @.p1 is 1 only
rows which has a matching row in tbl2 are to be returned. In this example,
SQL Server is actually able to avoid accessing tbl2 if @.p1 is 0, since
once @.p1 is evaluated, the other branch can be pruned. Note here that
is not your C-style of shortcutting - you get the same result if you
have the condition on @.p1 last.

To read more about this topic, I have an article on my web site:
http://www.sommarskog.se/dyn-search.html.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Erland Sommarskog" wrote.
> Gunnar Liknes writes:

> > Does MS SQL perform complete boolean evaluations? If (@.P1=-1) it should
> > not have to check if (Field1 = @.P1) because the result of the statement
is
> > already determined.

> The answer is that, yes, SQL Server is able to make logical shortcuts,
> but that is not applicable here.

<snip explanation
> To read more about this topic, I have an article on my web site:
> http://www.sommarskog.se/dyn-search.html.

Thank you Erland, your article was very helpful. I also found the topics of
your
other articles very interresting. I'll read the one about Arrays & Lists
when I have
some time.

Regarding search. I'll have to wait until we get more data in our database
before
I decide which search alternative to use. For now I stick to IF / OR.

Cheers
Gunnar

Monday, March 19, 2012

Displaying the available values for a parameter from the database

hI,
My report has 4 report parameters: @.manufacturer , @.brand, @.Start Date,
@.EndDate .
I want the @.manufacturer , @.brand to hsow the drop down list with distinct
values from the db. Now when in these 2 report parameters I do , Available
Values as Non Queried and the Value and lable as manufacturer , i get the
following errors:
"The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
depends on the report parameter â'manucodeâ'. Forward dependencies are not
valid."
"The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
depends on the report parameter â'StartDateâ'. Forward dependencies are not
valid."
"The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
depends on the report parameter â'EndDateâ'. Forward dependencies are not
valid."
Please help.
Thanks
--
pmudHi,
I found the solution to that. I created 2 datasets: one for desplaying the
manufacture and one for displaying brand. Then in Report parameters Available
Values" I put these new datasets respectively for brand and manucode and
chose the value and label. :)
--
pmud
"pmud" wrote:
> hI,
>
> My report has 4 report parameters: @.manufacturer , @.brand, @.Start Date,
> @.EndDate .
> I want the @.manufacturer , @.brand to hsow the drop down list with distinct
> values from the db. Now when in these 2 report parameters I do , Available
> Values as Non Queried and the Value and lable as manufacturer , i get the
> following errors:
> "The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
> depends on the report parameter â'manucodeâ'. Forward dependencies are not
> valid."
> "The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
> depends on the report parameter â'StartDateâ'. Forward dependencies are not
> valid."
> "The report parameter â'manucodeâ' has a DefaultValue or a ValidValue that
> depends on the report parameter â'EndDateâ'. Forward dependencies are not
> valid."
> Please help.
> Thanks
> --
> pmud

Displaying selected parameters in a report

Hi,

In the report I'm working on, I want to display a list of the parameters selected by the user, as in:

Selected Cars:
Toyota Camry
Ford Taurus
Chevy Corvette
Saturn Ion

Note that these are selected items from a multi-value parameter. How can I go about doing this with Reporting Services 2005? In ASP.NET, I'd just use the parameter array as the datasource for a repeater/datagrid/gridview. Could I do something similar with SSRS? I'd really like to use the format specified above, whether or not it is in a table; I really don't want to do the following:

Selected Cars: Toyota Camry, Ford Taurus, Chevy Corvette, Saturn Ion.

Thanks,
MarkOkay, I figured out how to do this using the following expression:

=Join(Parameters!parameter_name.Value, vbNewLine)

My question now is, can I use the parameter label instead of the value? Or, alternatively, is there a way to trim a character off the end of the value when displaying it? In my stored proc, I had to append a delimiter (a | in my case) to the value, but I don't want this to appear in the report.

Right now, it looks like:

Selected Cars:
Toyota Camry|
Ford Taurus|
Chevy Corvette|
Saturn Ion|

Thanks,
Mark|||

To show the Parameter label, use the .Label property instead of .Value:

Parameters!parameter_name.Label

For multi-value parameters, the Label property (like the Value property) will return an array of values so you will have to Join() them.

|||I tried that earlier and got an error, but I must have done something else wrong because I just tried it again and it works. Thanks!

Displaying report parameters in report header or body

Hi,
I like to see in the generated report what the parameters value are for the
current report like startdate and enddate
Thanx WimmoYou can do this by adding a textboxes to the page header and using
expressions like:
=Parameters!startdate.Value
=Parameters!enddate.Value
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Wimmo" <Wimmo@.discussions.microsoft.com> wrote in message
news:A1F341D0-9A5A-463E-9974-18A0232F9072@.microsoft.com...
> Hi,
> I like to see in the generated report what the parameters value are for
the
> current report like startdate and enddate
>
> Thanx Wimmo

Displaying Report Parameters in File Name

Does anyone know if it is possible to set up a subscription that includes
report parameters in the subject line when emailing a report or report link?
Thanks for the help!!
AnthonyThe only way to accomplish this is to use data driven subscriptions. Even
with this approach you would need to write your query to build up the
subject line.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"anthonysjo" <anthonysjo@.discussions.microsoft.com> wrote in message
news:8396CC2A-C4C2-4477-AA68-E1508A7159AD@.microsoft.com...
> Does anyone know if it is possible to set up a subscription that includes
> report parameters in the subject line when emailing a report or report
> link?
> Thanks for the help!!
> Anthony|||Ok that is the only way I could think of. Thanks!
"Daniel Reib [MSFT]" wrote:
> The only way to accomplish this is to use data driven subscriptions. Even
> with this approach you would need to write your query to build up the
> subject line.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "anthonysjo" <anthonysjo@.discussions.microsoft.com> wrote in message
> news:8396CC2A-C4C2-4477-AA68-E1508A7159AD@.microsoft.com...
> > Does anyone know if it is possible to set up a subscription that includes
> > report parameters in the subject line when emailing a report or report
> > link?
> >
> > Thanks for the help!!
> >
> > Anthony
>
>

displaying report parameter names and values in a textbox

I'm trying to return the parameters used in a report in the report footer. Where it is no problem getting back the values I would also like to display the actual parameter name. However I haven't found a way to do that yet.
My hunch is this needs to be done with embedded code. If anyone has got the answer to this I'd be very glad if you could share it.
thanks a lot
Axe
From http://www.developmentnow.com/g/115_2004_7_0_21_0/sql-server-reporting-services.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.comUse Parameters!ParamName.Label
"Axel" wrote:
> I'm trying to return the parameters used in a report in the report footer. Where it is no problem getting back the values I would also like to display the actual parameter name. However I haven't found a way to do that yet.
> My hunch is this needs to be done with embedded code. If anyone has got the answer to this I'd be very glad if you could share it.
> thanks a lot
> Axel
> From http://www.developmentnow.com/g/115_2004_7_0_21_0/sql-server-reporting-services.htm
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com
>

Sunday, March 11, 2012

Displaying Multi-valued parameters

Hi There.

I am struggling with an issue with multi-valued parameters. I have a parameter that is a list of several hundred items and when someone selects all of them, I display the huge list in the report header vias the join command.

This works great for a few parameters, but overwrites my data when the list is large. I want to do something in the expression where I determine if all items are selected and then just display 'All' instead of the whole list. Any ideas would be very helpful!

Thanks, Mike

see this code from msdn, modify it to suit your need, if parameter.Value(i) <> " " then increase a counter value, at the end check if counter = total count in parameter then display all

to call the function in the expression

=Code. ShowParameterValues(Parameter!SomePara)

hope this helps

Public Function ShowParameterValues(ByVal parameter as Parameter)
as String
Dim s as String
If parameter.IsMultiValue then
s = "Multivalue: "
For i as integer = 0 to parameter.Count-1
s = s + CStr(parameter.Value(i)) + " "
Next
Else
s = "Single value: " + CStr(parameter.Value)
End If
Return s
End Function

|||

Thanks for the guidance Yashant!

I have not done custom code in a report. I think the

=Code. ShowParameterValues(Parameter!SomePara)

goes in the expression of the textbox correct?

Where does the function go? Is it under the report properties code tab?

Thanks, Mike

|||yes, the expression goes into the text box and code goes in reports properties code tab. you need to modify the code to work for you.

Friday, March 9, 2012

Displaying Dynamically created columns

Hello,
I have a stored procedure that accepts input parameters and depending
on the input, returns multiple columns. For example depending on the month
range passed in, the stored procedure creates and populates temporary table
with columns for each month and returns the values in the temporary table.
How do I display these dynamically created columns using Reporting Services
(the number of coulmns returned by the stored proc varies between different
runs). Any help is appreciated.Sunil,
You would need to use the matrix control and then edit the
matrix_columngroup to use the data returned from your stored proc.
Hope this helps.
Bill Youngman
Anexinet, Inc.
"Sunil Oliver" <SunilOliver@.discussions.microsoft.com> wrote in message
news:D11DBA4E-C99F-4E37-8C0D-7F9D76192001@.microsoft.com...
> Hello,
> I have a stored procedure that accepts input parameters and
depending
> on the input, returns multiple columns. For example depending on the month
> range passed in, the stored procedure creates and populates temporary
table
> with columns for each month and returns the values in the temporary table.
> How do I display these dynamically created columns using Reporting
Services
> (the number of coulmns returned by the stored proc varies between
different
> runs). Any help is appreciated.

displaying different reports based on a parameter

Hi,

I have bunch of reports that take same set of parameters. I am trying parametrize the report type so that depending on the report type selected, body should display that report when user hits "View report" button. How can I do this? Pardon me if there is an obvious solution as I am pretty new to the joys of MS Reporting Services.

Thanks a bunch.

add a subreport control and then set the sub report name using an expression

Friday, February 24, 2012

Display Selected Parameters in Report

Is there a way of showing which parameter values were chosen from a multi-value parameter list in RS 2005?

I want to show in the Report Header the parameters that have been chosen. There are "Count", "Value", "Label", "IsMultiValue" options in the expression builder for the parameter but no way of knowing which ones were selected?

Found the answer....from Robert....

Once you mark a paraeter as "multi-value", the .Value property will return an object[] with all selected values. If only one value is selected, it will be an object array of length = 1. Object arrays cannot be directly compared with Strings.

To access individual values of a multi value parameter you can use expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert

Display selected multivalue parameters

I would like to display the selections made for a parameter in a multi select dropdown.

If i do as following for a textbox..doesnt work.

=Parameters!STORELOCATION.Label.ToString

I would like the labels to be displayed as below.

Report is for the following stores: abc, xyz

Pls help!

Use this expression...

=Join(Parameters!Storelocation.label, ", ")

|||Thank you !! This works..

Display selected multivalue parameters

I would like to display the selections made for a parameter in a multi select dropdown.

If i do as following for a textbox..doesnt work.

=Parameters!STORELOCATION.Label.ToString

I would like the labels to be displayed as below.

Report is for the following stores: abc, xyz

Pls help!

Use this expression...

=Join(Parameters!Storelocation.label, ", ")

|||Thank you !! This works..

Display Report Title in Report

Hello,
I am trying to display the report title with from and to dates. I currently have start and end dates as parameters and when I insert into my report in the 'Design' view the dates do not appear when refreshed. Please provide how to steps. Help!!!!
JSjust drag and drop ur date parameters in page header and preview report, it will prompt you to enter parameter values...

Display Report Name above the Parameters

I have a report that I am calling via a URL and displaying it in a new
browser window.
I would like to add the name of the report to the top of the window somehow
so that the user knows exactly which report they are entering the parameters
for before clicking the View Report button.
Is there an easy was to do this?One alternative would be to display the name of the report in the report's
header with Globals!ReportName
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
"Branden" <Branden@.discussions.microsoft.com> wrote in message
news:F1F3A567-1CB9-4FC7-96E0-D5E8419EA3A5@.microsoft.com...
>I have a report that I am calling via a URL and displaying it in a new
> browser window.
> I would like to add the name of the report to the top of the window
> somehow
> so that the user knows exactly which report they are entering the
> parameters
> for before clicking the View Report button.
> Is there an easy was to do this?
>|||Thanks Alain, but I would like to show the report name before the report is
even rendered. I'd like to show it above where the parameters are even
entered by the user.
"Alain Quesnel" wrote:
> One alternative would be to display the name of the report in the report's
> header with Globals!ReportName
>
> Alain Quesnel
> alainsansspam@.logiquel.com
> www.logiquel.com
>
> "Branden" <Branden@.discussions.microsoft.com> wrote in message
> news:F1F3A567-1CB9-4FC7-96E0-D5E8419EA3A5@.microsoft.com...
> >I have a report that I am calling via a URL and displaying it in a new
> > browser window.
> >
> > I would like to add the name of the report to the top of the window
> > somehow
> > so that the user knows exactly which report they are entering the
> > parameters
> > for before clicking the View Report button.
> >
> > Is there an easy was to do this?
> >
>|||On Apr 17, 6:53=A0pm, Branden <Bran...@.discussions.microsoft.com> wrote:
> I have a report that I am calling via a URL and displaying it in a new
> browser window.
> I would like to add the name of the report to the top of the window someho=w
> so that the user knows exactly which report they are entering the paramete=rs
> for before clicking the View Report button.
> Is there an easy was to do this?
Try adding a new parameter to the report called ReportName with the
prompt as Report Name: and set the non-queried default value to
=3DGlobals!ReportName. If you make it the first param in the list
it'll show above the other params.
It works when running it in Preview and Report Manager. I would think
it should work when calling the report from a URL.
HTH
toolman

Sunday, February 19, 2012

Display Parameters/Global variables

I am trying to display this in TextBox in the Footer:
This is Page =Globals!PageNumber
However, it doesn't work. It only works if I remove the "This is Page". Is
there any way so that I can use one text box to display both my text and the
variable?
Thanks.You have to use string concatenation:
="This is Page " & Globals!PageNumber
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Zean Smith" <nospam@.nospamaaamail.com> wrote in message
news:ZvOdneXAJd3bEqTeRVn-iw@.rogers.com...
>I am trying to display this in TextBox in the Footer:
> This is Page =Globals!PageNumber
> However, it doesn't work. It only works if I remove the "This is Page".
> Is
> there any way so that I can use one text box to display both my text and
> the
> variable?
> Thanks.
>
>

display parameter value on Report Builder generated report

hi all,
is it possible to display the parameter value on the report for
parameters which contain multiple selection ?
i can display the parameter value if it has only 1 value. how can i
display the values if there are more than 1 ?
Thanks!Yes can be done. use
e.g in your text box
=Join(Parameters!empno.Value, ",")
Amarnath
"minority" wrote:
> hi all,
> is it possible to display the parameter value on the report for
> parameters which contain multiple selection ?
> i can display the parameter value if it has only 1 value. how can i
> display the values if there are more than 1 ?
> Thanks!
>|||thanks Amarnath.
previously, i tried Parameters!empno.value because i only filter by 1
value but will have error. so i didn't think that the Join function
will work.
thanks.

Display output parameters from stored procedure

Hi,

I have a report that uses a stored procedure. The stored procedure has 3 parameters 1 input and two output and also returns a resultset.

I have managed to hide the user prompt by changing the prompt for the two output parameters to an empty string.

The report runs fine and the user is not prompted for these two values, however the report does not show the values that are returned by these output parameters.

I could add extra fields to the resultset and not bother with the ouput parameters but this seems extremely inefficient as the resultset could contain several thousand rows and the fields would be the same for every single row.

Is it possible to display output paramater values?

Thanks In Advance

Chris

Chris,

have you thought of redesigning your stored procedure?

split it into two sp's, one containg the resultset, the second containg your output parameters, which should be redefined as "normal" parameters and brought back as a resultset via select @.parm1, @.parm2.

cheers,
Markus

Display of Parameters

Hi,
I need to develop 2 reports using Crystal Reports 11. Both the reports are very similar except that one accepts 2 parameters & the other accepts only one parameter & hence their selection criteria would differ accordingly. I was wanting to know if I could merge both the reports into one, such that I use a third parameter which is boolean & asks which kind of report the user wants to see. Based on the boolean value the report needs to display either 1 parameter or both the parameters. Is this possible in crystal reports ? If not, what is the other best way I could do this ? Please suggest.Hi
Yes ur approch is right, u can do that. Make a single report and accept 3 parameters. based on parameter 1 filter ur report data in a if else condition in record selection formula.|||u can create any report based on different parameters at runtime. of course that means u have to code it in a more generic way... I have done this, bt its in vc++. I suggest u look into the sample code if u want it in vb...its not that hard...
ps: sample code is in ur crytl installed folder.|||Thanks for the responses. If i try using a 3rd parameter method, I have a problem. That is, I can filter the records perfectly fine, however when the parameter window shows up it shows all the parameters in it, the one's that the first report would use & the ones that the second report would also use. I dont want that. Based on the value of the boolean parameter, it should show the corresponding parameters for the first report & accordingly for the second. how do i achieve this ? I'm using only crystal reports....|||Thanks for the responses. If i try using a 3rd parameter method, I have a problem. That is, I can filter the records perfectly fine, however when the parameter window shows up it shows all the parameters in it, the one's that the first report would use & the ones that the second report would also use. I dont want that. Based on the value of the boolean parameter, it should show the corresponding parameters for the first report & accordingly for the second. how do i achieve this ? I'm using only crystal reports....

Hi
If u r not using any front end then u can use two seperate sub reports (on demand sub report) in main report. so number of reports are increased now.

Friday, February 17, 2012

display multi value parameters in textbox

Hello,

I have the following problem.

i have a report where you need to fill in a few parameters

start date, end date and subject selection.

the subject selection is a multivalue paramter (select all, param1, param2, param3)

the multivalue parameter is based on another dataset with paramid as value field and paramdescription as value label.

in my report i want to display something like this :

from startdate to enddate

summary for campaign(s) : selected parameters.

in the selected parameters is can display a =join(Parameter!campaig.value) but this only returns the 32bit guid.

instead i would like it to display the parameterdescription label.

anybody has some ideas ?

greetings

vince

Hi Vince,

I think using the expression =Join(Parameters!campaign.Label) should give you the desired result.

-Aayush