SSRS: Show Parameters

  • I want to show (print) parameters on the print of the Reports, not on the Preview/Excel/Screen.

    Example: User Selected From and To date for report. I am not showing From and To dates on the screen, but when I click on print and printing report then I want to print From and To date on paper.

    Is it possible in SSRS without using .net?

  • Hi Deepti,

    Well..nothing is IMPOSSIBLE...

    But, in SSRS...When we choose any parameters..any kind of...it gets the report content according to that condition only...And unless and untill you place it on Report by any means...[Using textboxes..or on table itself..]...I think..it will not be displayed on paper....:)

    ..from my side, definitely I will try for this..

    But..if you find any solution for the same...pls let me know...Ok...

    Thanks,

    Niraj

  • Id try adding a label on the report with value coming from the parameter as an expression .

    =Parameters!Date.Value this will be displayed when u preview the report as well as when u print

    cheers

    J

    Jayanth Kurup[/url]

  • Hi Deepti,

    As recommended by JayKay that's what I do too.

    Example:="Report Period: " & Format("dd-mm-yyyy",Parameters!StartDate.Value) & " to " & Format("dd/mm/yyyy",Parameters!EndDate.Value)

    To show multivalue parameters can try something like this:

    = Join(Parameters!Customer_Group.Value,", ") & " customers. Records Found: (" & CountRows().ToString & ")"

    Regards,

    Barkha.

  • Thanks to you all. But my client wants to show these parameters when they print the report not in preview. Because at the time of preview all the parameters are visible on the top, but when we print the report SSRS not prints the parameters.

    I did the same, on the top header row I am showing all the parameters and report title, but now they don't want this row in preview. I have given option of text boxes also but they are not agreeing.

    As per my understanding we can't change the visibility of the objects (Text Box or row) on the click of print option and we don’t have any setting/property for print option to print parameters or not

  • Hi Deepti,

    what i have always done with parameters is to put them on the very last page of the report by themselves, after the report total. this way the client view the report on the screen without looking at the parameters, can print the entire report, which will show the parameters at the very end of the report, or print (if rendered to pdf) all pages and exclude the parameter page if they wish. i also always make it a practice to put on the bottom of each page "page # of total# (example page 1 of 10). this way if they print 9 pages of a report, and state that the data on the report is not what they selected, you can ask them to produce page 10 (the parameters page) and recheck their results.

    hope this helps

    eaa

  • Can also set Visibility option Hidden to False for row containing textbox that displays parameters, and then set property for ToggleItem. Will allow user to click a textbox to display parameters for printing.

    Barkha.

  • i would write a function in the Code section of my report something like ShowMyParameters:

    public Shared Function ShowMyParameters(byval productType as Parameter) as string

    Dim s as String = ""

    'got product?

    if productType.label.tostring() <> "ALL" then

    s = s + "Product: " productType.Label.Tostring() + vbNewLine

    end if

    return s

    end function

    then, i'd place the text box on my report and entered this: =Code.ShowMyParameters(Parameters!productType)

    this will do it. of course, you can add as many as you wish into your function :-).

    does it answer your question?

  • Dude,

    I changed the values to reflect what is in my report, but I keep getting an "End of Statement Expected" error.

  • I have had a similar question some month ago and I couldn’t find a real solution after working some days on it!

    The problem is: when you want to print out a report this report is already rendered with or without the parameters you are speaking of. There is no way in the report designer to implement anything depending on the target of rendering (HTML, XLS, PDF, …).

    I have now inserted an additional parameter . If this parameter is set to true I show the parameter, if it is set to false I hide them.

    The user has to decide whether he want to see the parameters or not.

    If someone has a better idea, I’m also interested in a real solution.

  • In SSRS 2008 I used the following.

    =Join(Parameters!Gender.Value,", ")

  • barkha.javed (5/7/2008)


    Hi Deepti,

    As recommended by JayKay that's what I do too.

    Example:="Report Period: " & Format("dd-mm-yyyy",Parameters!StartDate.Value) & " to " & Format("dd/mm/yyyy",Parameters!EndDate.Value)

    To show multivalue parameters can try something like this:

    = Join(Parameters!Customer_Group.Value,", ") & " customers. Records Found: (" & CountRows().ToString & ")"

    Regards,

    Barkha.

    Barkha, thank you! That's exactly what I needed. I've been struggling with custom code all morning (2 hours so far!) and this simple little "Join" statement is all I needed. I changed .Value to .Label and I'm off and running.

  • You might want to use your own Join function that will work with muti-value and single value parameters.

    Public Shared Function MyJoin(ByVal parameter as Parameter, ByVal Delimiter as String) as String

    On Error Goto ProcError

    Dim s as String

    s = ""

    If parameter.IsMultiValue then

    For i as integer = 0 to parameter.Count-1

    s = s + Delimiter + CStr(parameter.value(i))

    Next

    if s.length > 0

    if left(s, 1) = Delimiter then

    s = right(s,len(s) - 1)

    End If

    End If

    Else

    s = CStr(parameter.Value)

    End If

    Return s

    ProcError:

    Return err.description

    End Function

  • The purpose of the preview is to see how the reports will be printed.

    If the customer doesn't want to see some data on the preview, I would create a different way to preview the data (a data grid or something like that) and when the user click on the print button, it will create a SSRS report directly to the printer.

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

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