SSRS Report : Help Me to display text box values in Header of the report

  • Hello guys,

    sorry if I am posting in the wrong section of the Forum, I am looking for the help on SSC.

    My Issue:

    Hey guys, I have a requirement form the SharePoint developing team, they have given me a simple SELECT statement with a Where Condition and asked me to develop a report and I did.

    so far so good. Now, they want to have a Dynamic Report Headeing which displays different Heading for Different Report-data, to explain more here is a screenshot:

    when the report fetches the data for 5 countries then they need heading like "List for - COUNTRY1 COUNTRY2 COUNTRY3 COUNTRY4 COUNTRY5"

    but,

    - They don't want additional DataSet

    - They don't want any changes to the query (which they gave)

    - They don't want any additional Parameters

    in shot,

    as per my understanding, i guess they are asking me to write custom code to do so! (in VB.NET)

    and i have no idea about it

    Please do help me guys

    Best Regards,

    Cheers

  • Youre looking for an expression in a text box where: either 1. a parameter like, =Parameters!Month.Value or 2. a field value like, =Field!(yourfield).Value.

  • To expand on what Mr. Garrison said:

    You can refer to objects in the body of the report by object NAME in the header, so a way this is often solved is by adding a textbox (let's say it's called Textbox21) tucked away in the body that shows exactly what you want (e.g. Fields!somefields.value), setting Textbox21 to be Hidden, and then adding a box in the header that points to that hidden textbox by it's object name (e.g. ReportItems!textbox1.Value).

    Try that and see if it works!

  • ^ thanks for the reply

    i did the same which is placed here in the tutorial

    http://www.heysup.net/ssrs-tutorials/sql-server-reporting-services-ssrs-how-to-display-textbox-value-in-header-of-the-report/268/

    but the thing is i need coma separated value if more then 1 county is in result by using Reportitems!TextboxName.Value I am ending up with Last country name being displayed. I mean if i have 2 countries in result set I end up with 2nd country being dispalyed

  • You might want to take a look at:

    http://www.mssqltips.com/sqlservertip/2972/sql-server-reporting-services-reportitems-collection/[/url]

  • Are the groups always exactly the same as the parameter? E.g. Are the users selecting from a list of countries? Are the display values for the Parameter the same as what they'll be show in the report for the Group headers? In that case, you can try this (which should work in a text box directly in the report header):

    =Join(Parameters.YOURPARMNAME.Label, ",")

    That will get you a comma-separated list of the labels (i.e. not the values, but what shows in the parm dropdown list) of however many user-selected parms there were (I don't know if you'll always have 5 or not).

    Let us know if that works!

    Cheers,

    EJM

  • eric.muller (7/23/2013)


    Are the groups always exactly the same as the parameter? E.g. Are the users selecting from a list of countries? Are the display values for the Parameter the same as what they'll be show in the report for the Group headers? In that case, you can try this (which should work in a text box directly in the report header):

    =Join(Parameters.YOURPARMNAME.Label, ",")

    That will get you a comma-separated list of the labels (i.e. not the values, but what shows in the parm dropdown list) of however many user-selected parms there were (I don't know if you'll always have 5 or not).

    Let us know if that works!

    Cheers,

    EJM

    Hello EJM,

    thanks for the reply and yes users select the groups from the dropdownlist

    and as far as JOIN is considered they have restricted me not to add any additional parameters.

    which is the worst part 🙁 orelse we could achieve this task easily

  • immu_20 (8/13/2013)


    eric.muller (7/23/2013)


    Are the groups always exactly the same as the parameter? E.g. Are the users selecting from a list of countries? Are the display values for the Parameter the same as what they'll be show in the report for the Group headers? In that case, you can try this (which should work in a text box directly in the report header):

    =Join(Parameters.YOURPARMNAME.Label, ",")

    That will get you a comma-separated list of the labels (i.e. not the values, but what shows in the parm dropdown list) of however many user-selected parms there were (I don't know if you'll always have 5 or not).

    Let us know if that works!

    Cheers,

    EJM

    Hello EJM,

    thanks for the reply and yes users select the groups from the dropdownlist

    and as far as JOIN is considered they have restricted me not to add any additional parameters.

    which is the worst part 🙁 orelse we could achieve this task easily

    It seems you didn't understand what I was suggesting. The JOIN function is not a parameter; it will just list together in a character-delimited list (in this case a comma) whatever array you pass to it. In the case of this, it will take the labels of all the selected user parameters and then spit them out into a list, which I believe was your initial requirement. You're not adding a parameter, you're adding a text box, which should be acceptable.

    Take a look at THIS[/url] link for more info, and good luck.

    EJM

Viewing 8 posts - 1 through 7 (of 7 total)

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