Navigating to alternate reports

  • Hi.

    I was just wondering whether it's possible, using SQL Server 2000 Reporting Services, to change which report to navigate to depending on the value of a certain field. I refer to the 'Action' property of a field where you can set what report (or url) to navigate to when a field is clicked.

    So, for example,

    If the value of a field is 1, navigate to an existing report called 'Report 1'

    If the value of a field is 2, navigate to an existing report called 'Report 2'

    .. and so on.

    Can I do this using an expression in the 'Jump to report' option of the 'Action' property?..

    Thanks.

    Dave

  • Yes it is possible.

    =iif(Parameters!name.Value = "VVV", "Report_1", "Report_2")

    Assume that you have two report Report_1 and Report_2 and Report_1 populates if your name parameter is VVV otherwise it will populate Report_2.

    Regards,

    vijay

  • Nice, thanks for that. One more thing... what syntax do I use to pass a parameter to the report I'm navigating to (when using an expression like below)? I've tried a few combinations but all I get is compilation errors. Say I wanted to pass p1.value to "Report_1" or "Report_2".

    =iif(Parameters!name.Value = "VVV", "Report_1", "Report_2")

    Thanks again for you help.

    Dave

  • Grasshopper, heres the navigation string from one of my linked subreports ('ShowVRDetail' with parameter 'ApptID') ....

    [font="Verdana"]="void(window.open('http://reports/ReportServer?" & Globals!ReportFolder & "%2fShowVRDetail&rs:Command=Render&ApptID=" & Fields!AppointmentID.Value & "'))"[/font]

    Note: this opens the subreport in a new pop-up window, I prefer that than the user having to hit the back key to go back to the main report - this way they can open as many subreports as they like in new ie windows.

    Use the Globals.ReportFolder global so your subreport runs from any directory (i.e. reports/Test and reports/Production).

    If you want to call different reports depending on the param the user picked you can go...

    [font="Verdana"]="void(window.open('http://reports/ReportServer?" & Globals!ReportFolder & "%2f" & IIF(MyParam = value, "Report1","Report2") & "&rs:Command=Render&ApptID=" & Fields!AppointmentID.Value & "'))"[/font]

    That should work (haven't tried it myself).

    Hope that helps

Viewing 4 posts - 1 through 3 (of 3 total)

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