[英]execute javascript function in a another iframe when parent is from different domain
[英]Calling JavaScript from SSRS Report is not working when the report is hosted in Iframe with domain different than that of Parent Page
我有一個帶有RSS鏈接的SSRS報告,該鏈接使用JavaScript在另一個窗口中打開子報告。 該SSRS報告托管在另一個網站的Iframe中。 當網站和SSRS報告位於同一域 (例如http://myserver.com/reportserver/和http://myserver.com/MyWebsite/ )時,它可以正常工作。 但是,當網站和SSRS報表服務器位於不同的域時 ,它將停止工作。 似乎JavaScript調用已被禁用,我什至嘗試使用簡單的alert('Hello')
從SSRS報告中發布警報,但是直到我將SSRS和網站都重新置於同一個域中后,它才起作用。
注意:僅在IE中會出現此問題,在chrome中它運行正常,我正在使用SQL Reporting Services 2008 R2 。 IE版本為9和10
如果我們避免顯示報表的工具欄元素,則可以解決此問題。
這意味着您必須添加其他URL參數,以避免呈現工具欄。 示例網址:http:///&rs:Command = Render& rc:Toolbar = False
已更新(無需省略工具欄)
添加其他網址參數rc:LinkTarget = _self或rc:LinkTarget = _blank 。 因為默認情況下,SSRS報告將其鏈接與目標屬性的鏈接呈現為“ _top”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.