parameter as lable in report(SSRS)

  • hi,

    I have a req where i want to show the parameter selected in the report.

    I am using parameter!productid.label but it shows as blank.

    The user can select one or multiple or all productid for the report.

    How can i get it .

    i have a cube on which i am building the report.

    I also tried using a iff statement,but that gives a error.

    I will appreciate if somebody can help on this.

    thanks

    Ashish

  • Just a reminder that everything is case sensitive when you are referring to items in SSRS and that is because of the RDL definition which is XML.

    The formula that you would want for a multi-value parameter would be the following: JOIN(Parameters!parameter name.Label, ", ")

    You will need to substitue your name for the parameter and make sure that it is spelled the same.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Hi Dan,

    Thanks for the reply.But i did tried that as well.i used Join and did took care of the cases.actually just to check i just tried what all you said.even than it comes as blank.the report just doesn't show anything for that textbox.

    does it has something to do with the cubes.we have some other reports made on the tables directly.

    n we used

    =IIF(Isnothing(Parameters!Specialty.Value), "All", First(Fields!SpecialtyNames.Value, "DataSet3"))

    it works in that report but not in our new reports which we are making on a cubes.

    any ideas.

    thanks

    ashish

  • This will work, so most likely need more information as to how you have your report setup and the parameters. I created a quickly report off the Adventure Works DW SSAS database with the Country as a parameter from the Geography dimension. I then setup a textbox on the report with the following expression:

    =JOIN(Parameters!GeographyCountry.Label,", ")

    This provided me the default parameter I had setup as 'United States' and then when I resubmitted the report with more selections it included the additional countries.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Thats what i m trying ,but it doesnt seem to work.I can provide more information about the report i have.

    I start with two parameters.out of which only one is for the user ,the other is hidden .

    the other parameter is procedurecode . the data source for the report is analysis services.

    the value for this parameter is set as multi value.

    available value are set as non-queried.

    and default values are also non queried.with value as [procedure].[procedure code].&[9242].

    thats the label i want.i.e., 9242.

    i also read some where that in some cases the label comes as blank.but i m not sure abt it.

    any ideas.

    thanks

    ashish

  • I have a parameter called LocationState . from the dimension location.the label for that is State.i gave this value for the textbox in the layout.It came as blank.

    =JOIN(Parameters!LocationState.Label,", ")

  • Also,

    i read somewhere that when we use some parameter as field!locationstate.value and we give the same as label.then it comes blank.

    do you have any idea about it.

    i am trying to explain the situation i have,if you need anything else.i will be glad to provide.

    thanks in advance.

    thanks

    ashish

  • Since you are not populating the information for the parameter from SSAS then it makes sense that this is coming back blank. Go into the SSAS query designer and setup the filter for your value as the default and check the box for Paramters. Use this instead of trying to setup the parameter that you have manually. This should produce the results that you are looking for.

    Here is a screenshot of an example showing how to setup a parameter - Query Designer Screenshot. In this the filter is setup for Product Category and there is two default selections made, Bikes and Components, and it is setup as a Parameter. Setting up the filter as a parameter will generate the dataset to use for the parameter and it will also include this logic into your MDX for the main query.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Hey Dan,

    Thanks for all the help.

    As you have shown ,i have exactly the same setup.

    i attached the screenshot for the designer page.

    i have some parameteres out of which most are used as fields as well.

  • i just tried this.

    =IIF(IsNothing(Parameters!LocationState.Value), "All" ,"State:" & Fields!LocationState.Value)

    doesnt give a blank for a change.but gives error.:P

  • Getting confused based on the different information you provided for the procedure parameter and now this screenshot trying to get at the location information.

    As far as the LocationState you want to continue to reference the Parameters object and not the Fields. It appears that you are mixing up the logic in the expression. If this is multi-value then you need to utilize the JOIN to get the selections.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Just hit this.

    if instead of using label.i use value.it shows the selected value,but in a form of a query like.

    here it showed [procedure].[procedure code] &[9242].

    whereas i just wanted 9242.

    is their way i can trim this like we do in T-Sql.

    i am trying to avoid using script.

  • i am sorry about that.may be i gave so many different pieces of information togather.

    actually those are two different parameters in two different report.

    the screen shot i gave.if you can take a look at it and tell me if you see anything incorrect there.

    i think it the way we wanted for the label field right.

    but it still comes as blank.

    let me summarize for you.

    i tried join ,

    i tried label.

    i tried iff statement ,as we did in old reports that were based on tables directly.

    nothing seems to work.

    all blank.

    does this makes it little clear

    thanks

    ashish

  • I have definitely provided enough information and detail as to resolving the issue and it definitely works as stated. Please review your expressions to ensure they are referencing Parameters object and not Fields as stated. For the other item utilize the built in functions and parse out the information you are wanting to display.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Dan,

    i really appreciate your help and suggestion.

    Looks like its some innate problem with the way we are refrencing our cubes.

    But you have given a good deal of information...

    thanks a lot

    ashish

Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply