locked
call a JS method RRS feed

  • Question

  •  

    How can I call a Javascript method from table cell. Javascript method is on the page, that has the report on it.

     

    Please help

    Thanks

    -Sarah

    Thursday, October 30, 2008 12:39 AM

Answers

  • I have resolved it..

     

     

    User hyperlink Target property of report viewer.
     

    <rsweb:ReportViewer HyperlinkTarget="_self" ID="ReportViewer1" runat="server" ProcessingMode="Remote" ShowParameterPrompts="False" Width="100%" Height="100%">

    </rsweb:ReportViewer>

    Then in teh report, in the navigation tab, go to URL selection, put this in

    ="javascript: " + "window.parent.SelectTab('tabScoreCard','EE_" + Fields!EE.Value.ToString() + "')"

     

    The above call to javascript wouldnt work if the hyperlinkTarget property is not set, as it will not know which the parent of which window  has that JS funtion.

     

    -Sarah

    Thursday, November 6, 2008 7:44 PM

All replies

  • Hi Sarah,

     

    Reporting Services doesn’t support embedding javascript methods within a report. However, Reporting Services supports embedding code within a report and referring to methods within a custom assembly. Methods in embedded code must be written in Microsoft Visual Basic. A custom assembly can be created using the Microsoft .NET Framework.


    For more information reference to using Custom Code References in Expressions, please go to http://msdn.microsoft.com/en-us/library/ms155798(SQL.90).aspx.

     

    If there are any more questions, please let me know.
    Thanks.

    Tuesday, November 4, 2008 7:47 AM
  •  

    Thanks for helping me here

     

    Let me explain what I am trying to achieve here, you may be right, there may be no solution to it.

     

    I have two iframes, A and B. Report is inside B and B is in iframe A.

     

    I am trying to get hold of a JS Function in iframe A from the report. I was able to do that by using this code

     

    ="javascript: document.getElementsByTagName('frame')[0].contentWindow.SelectTab('tabScoreCard','EE_" + Fields!EnergyExpertKey.Value.ToString() + "')"

     

    But this only works if the application has an absoulte path like

    http://localhost:3406/10_27_08/framer.aspx

     

    Now when I deploy the app within our main website. This application is in the content frame of our website. Like for example www.google.com.

     

    When the user clicks the link.. rather than going to the framer.aspx. It seems like its going to www.google.coma dn trying to find the JS Function relative to that link.

     

    I am having a feeling that the report always gets the relative link as the document or parent for the JS. It would be much easier if it could recongize or go from bottom up rather than from top to bottom. Like go from iframe B TO Iframe A. Rather than finding its way from www.google.com to the correct content iframe and then framer.aspx and then to iframe A. Which I am having difficulty with.

     

    Do you know how the reports act, am I correct in my understanding. Is there a way for it to take the framer.aspx as the parent path.

     

    Sorry if I confused you. But I need to get it done soon

     

    Thanks

    -Sarah

    Wednesday, November 5, 2008 6:09 PM
  • I have resolved it..

     

     

    User hyperlink Target property of report viewer.
     

    <rsweb:ReportViewer HyperlinkTarget="_self" ID="ReportViewer1" runat="server" ProcessingMode="Remote" ShowParameterPrompts="False" Width="100%" Height="100%">

    </rsweb:ReportViewer>

    Then in teh report, in the navigation tab, go to URL selection, put this in

    ="javascript: " + "window.parent.SelectTab('tabScoreCard','EE_" + Fields!EE.Value.ToString() + "')"

     

    The above call to javascript wouldnt work if the hyperlinkTarget property is not set, as it will not know which the parent of which window  has that JS funtion.

     

    -Sarah

    Thursday, November 6, 2008 7:44 PM