|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, May 11, 2009 3:40 AM
Points: 20,
Visits: 62
|
|
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
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 9:05 AM
Points: 530,
Visits: 1,020
|
|
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
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, May 11, 2009 3:40 AM
Points: 20,
Visits: 62
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:16 PM
Points: 9,
Visits: 64
|
|
Grasshopper, heres the navigation string from one of my linked subreports ('ShowVRDetail' with parameter 'ApptID') ....
="void(window.open('http://reports/ReportServer?" & Globals!ReportFolder & "%2fShowVRDetail&rs:Command=Render&ApptID=" & Fields!AppointmentID.Value & "'))"
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...
="void(window.open('http://reports/ReportServer?" & Globals!ReportFolder & "%2f" & IIF(MyParam = value, "Report1","Report2") & "&rs:Command=Render&ApptID=" & Fields!AppointmentID.Value & "'))"
That should work (haven't tried it myself).
Hope that helps
|
|
|
|