Open Subreport using Javascript

Hi

Can some please review and let me know what am I doing wrong in this piece of code.... cannot seem to get around this.

="javascript:void(window.open('"+Globals!ReportServerUrl +"/Pages/ReportViewer.aspx?"+Globals!ReportFolder+"/"+Parameters!SubreportName.Value+ "?Param1="&Parameters!Param1.Value.ToString()+ "&Param2="&Parameters!Param2.Value+ "','_blank'))

Basically, I'm trying to open a subreport using ActionURL but stuck this js.

It opens up the root folder rather instead of report... 

I also refereed this post: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6462b0f6-d784-4c7a-afe0-2813bec5770a/url-action-with-javascript-and-ssas-parameter?forum=sqlreportingservices

Version - SQL Server 2008R2





  • Edited by StSingh 11 hours 57 minutes ago
September 14th, 2015 2:26pm

Thanks for the quick response but its not helpful.

September 14th, 2015 6:05pm

Hi StSingh,

According to your description, you want to create a URL action to open a subreport via JavaScript, right?

In your scenario, it seems that both main report and subreport contain report parameters. If parameters in those two reports are multivalued, you can pass the parameter values from the main report to subreport with this section in JavaScript code:
&<subreport parameterer>=" &join(Parameters!<main report parameter>.Value,"& <main report parameter>=")
You can refer to this similar thread: Passing Multivalue Parameter in URL in SSRS 2008 not working.

If both parameters are not multivalued, you can refer to this thread: SSRS: How to open linked report with parameter in a new tab.

If you have any question, please feel free to ask.

Best regards,
Qiu

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 11:43pm

Is datasource based on sql table or a cube?
September 15th, 2015 2:14am

Views.
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2015 2:43am