2012-06-25 85 views
0

我有具有RadHtmlPlaceholder指向SSRS顯示,像這樣的報告Silverlight應用程序按鈕:導航回用Silverlight應用程序SSRS

<telerik:RadHtmlPlaceholder SourceUrl="http://serverName/ReportServer/Pages/ReportViewer.aspx?/Northwind/Employees&amp;rs:Command=render" /> 

這工作得很好,但是當我有一個報告,讓您向下鑽取以顯示子報告,但無需再次加載整個批次就無法回到父報告。似乎沒有選項可以打開導航按鈕工具欄選項,我已經看到了使用javascript將窗口位置設置回曆史記錄中的其他方法來實現後退按鈕,但顯然這不會在Silverlight應用程序中工作。無論如何要實現一個導航返回按鈕?

回答

1

看看這個線程上的Telerik的論壇:http://www.telerik.com/community/forums/silverlight/htmlplaceholder/html-place-holder-back-forward-refresh.aspx

基本上你需要從主持人獲得IFrame的手柄和注入一些JavaScript。歷史對象還有一個長度屬性,您可以使用它來評估是否應啓用按鈕。

public MainPage() 
     { 
      InitializeComponent(); 

      // Get the IFrame from the HtmlPresenter 
      HtmlElement iframe = (HtmlElement)htmlPlaceholder.HtmlPresenter.Children[0]; 
      // Set an ID to the IFrame so that can be used later when calling the javascript 
      iframe.SetAttribute("id", "myIFrame"); 
     } 

     private void Refresh_Click(object sender, RoutedEventArgs e) 
     { 
      // Code to be executed 
      string code = "document.getElementById('myIFrame').contentWindow.location.reload(true);"; 
      HtmlPage.Window.Eval(code); 
     } 

     private void Back_Click(object sender, RoutedEventArgs e) 
     { 
      // Code to be executed 
      string code = "document.getElementById('myIFrame').contentWindow.history.back();"; 
      HtmlPage.Window.Eval(code); 
     } 

     private void Forward_Click(object sender, RoutedEventArgs e) 
     { 
      // Code to be executed 
      string code = "document.getElementById('myIFrame').contentWindow.history.forward();"; 
      HtmlPage.Window.Eval(code); 
     } 
} 
+0

看起來它會起作用,更重要的問題已經出現,所以當我開始實施這個時,如果工作正常,歡呼吧! – knappster

+0

這個項目的任何新聞? –

相關問題