SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Open report in new window (Javascript)


Open report in new window (Javascript)

Author
Message
LittleKitten
LittleKitten
SSC Veteran
SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)

Group: General Forum Members
Points: 244 Visits: 165
Hi,

I am struggling to get this to work.
It does open up a new window and attempts to run the report. However i don't think it is recognising the parameters.
i.e. for FiscalYear I think it is passing through Fields!Fiscal_Year.Value rather than 2017.
How should I reference all of the paramaters?

="void(window.open('http://Test/PLReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fAcme+Test+Reports%2fCashier+Refunds+Detail&FiscalYear=Fields!Fiscal_Year.Value&FiscalWeek=Fields!Fiscal_Week.Value&StoreID=Fields!Store_ID.Value&FiscalWeekCaption=Parameters!FiscalWeek.Label&StoreName=Fields!Store_Number_Branch_Full_Name.Value&ProductItemHierarchy=Parameters!ProductItemHierarchy.Label&DepartmentCode=Fields!Department_Code.Value&rcTonguearameters=false&rs:Command=Render','_blank','width=800,height=600,left=250,top=50,scrollbars=1,resizable=1'))"


Sue_H
Sue_H
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41721 Visits: 11549
LittleKitten - Tuesday, August 29, 2017 5:15 AM
Hi,

I am struggling to get this to work.
It does open up a new window and attempts to run the report. However i don't think it is recognising the parameters.
i.e. for FiscalYear I think it is passing through Fields!Fiscal_Year.Value rather than 2017.
How should I reference all of the paramaters?

="void(window.open('http://Test/PLReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fAcme+Test+Reports%2fCashier+Refunds+Detail&FiscalYear=Fields!Fiscal_Year.Value&FiscalWeek=Fields!Fiscal_Week.Value&StoreID=Fields!Store_ID.Value&FiscalWeekCaption=Parameters!FiscalWeek.Label&StoreName=Fields!Store_Number_Branch_Full_Name.Value&ProductItemHierarchy=Parameters!ProductItemHierarchy.Label&DepartmentCode=Fields!Department_Code.Value&rcTonguearameters=false&rs:Command=Render','_blank','width=800,height=600,left=250,top=50,scrollbars=1,resizable=1'))"



If you have setup a parameter for Fiscal year then you would reference it with:
Parameters!ParameterName.Value

Fields!Fieldname.Value is a value in the dataset.

Sue



LittleKitten
LittleKitten
SSC Veteran
SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)SSC Veteran (244 reputation)

Group: General Forum Members
Points: 244 Visits: 165
Hi,
No, I pass through fiscal year in the dataset on purpose.
Anyway, I did solve my issue
The way to open up a new window in javascript with passing parameters is to do

&FiscalYear = " & Fields!FiscalYear.Value & " &FiscalWeek = " & Fields!FiscalWeek.Value & " and so on......
Fields! can also be Parameters! or whatever you want to pass through to the new report
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search