SQL Server Developer Center > SQL Server Forums > SQL Server Reporting Services > Help with text box expression using mdx parameter
Ask a questionAsk a question
 

AnswerHelp with text box expression using mdx parameter

  • Wednesday, November 04, 2009 4:17 PMramarama Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I am working on a report which uses ssas cube as data source, I have parameter in my report which i want show in a text box. I tried to use text box expression to include parameter value in text box but i didn't worked for some reason, can someone help me out with this.

    here is the expression and report preview

    expression : =Parameters!HomestoreOperationsStoreLocation.Value(0)

    Report Result : [Homestore Operations].[Store Location].&[Albuquerque-99, NM]


    i just want the store location ([Albuquerque-99, NM]) name without the whole path.

    thanks in advance

Answers

  • Wednesday, November 04, 2009 7:48 PMdbrooksTX Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Is your parameter set as multi-value?  It seems that this may be why you were using .Value(0).  If it is a multi-value parameter, you can use Join(Parameters!HomestoreOperationsStoreLocation.Label,", ") in your textbox expression to print the labels of all items in the multi-valued parameter separated by a comma and space.

    Hope that helps,

    David Brooks
    LiveLogic
    • Marked As Answer byramarama Wednesday, November 04, 2009 10:51 PM
    •  

All Replies

  • Wednesday, November 04, 2009 4:25 PMdbrooksTX Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Instead of using "=Parameters!HomestoreOperationsStoreLocation.Value(0)", use "=Parameters!HomestoreOperationsStoreLocation.Label".  That should give you the friendly name for that parameter value.

    David Brooks
    LiveLogic
  • Wednesday, November 04, 2009 4:31 PMramarama Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi David,

    Thanks for the quick reply, I have tried using "=Parameters!HomestoreOperationsStoreLocation.Label"      & =Parameters!HomestoreOperationsStoreLocation.Label .  but it didn't worked for me. #Error in the report text box.

    thanks.
  • Wednesday, November 04, 2009 7:48 PMdbrooksTX Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Is your parameter set as multi-value?  It seems that this may be why you were using .Value(0).  If it is a multi-value parameter, you can use Join(Parameters!HomestoreOperationsStoreLocation.Label,", ") in your textbox expression to print the labels of all items in the multi-valued parameter separated by a comma and space.

    Hope that helps,

    David Brooks
    LiveLogic
    • Marked As Answer byramarama Wednesday, November 04, 2009 10:51 PM
    •  
  • Wednesday, November 04, 2009 10:51 PMramarama Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi David,

    Thanks for the expression, It is working fine now.

    RamaRama