Call a javascript function from a report, the function is in aspx page


   How can I go about calling a javascript from from a report. The function is in teh code behind aspx page. When a user clicks a link on the report, this function needs to be called.

Further, the report sits in an iframe of the aspx page. So somehow I need access to the aspx page without opening any other pages.

I tried using this

="javascript:void SelectTab('tabScoreCard',EnergyExpert_" + Fields!EnergyExpertKey.Value.ToString() + "')"

 but that gives me an error of no object found, when the user hits the link on the report to go back to the code behind page.



Sarah Cameron Benjamin
10/15/2008 7:14:04 AM 4514 articles. 1 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 4



Based on your description, it seems that you are unable to get the Fields!EnergyExpertKey.Value object, so the ToString() method doesn’t work and the error occurred.


Please try to check if the field is accessible in your report.



Michael Jin.
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
10/21/2008 4:11:43 AM

Oh Ya, the field is very much accessable. Its the call to the JS that creates the error. Since the page is in an iframe, it seems like its having difficulty finding the function where it actually is in the hirechy of iframes in pages.


Looking forward to hearing back from you.




Sarah Cameron Benjamin
10/25/2008 2:58:56 AM

ok I have solved it, it may be helpful for others as well. Here is the solution


User hyperlink Target property of report viewer.

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


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

="javascript: " + "window.parent.SelectTab('tabScoreCard',EE_" + Fields!EEKey.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 Cameron Benjamin
11/6/2008 7:41:44 PM

Similar Artilces:

Call codebehind method from aspx page OR call javascript function of usercontrol control from page
Hi, I have a page which contains a user control.  When a user clicks on a submit button, I'd like to detect when elements in the user control have changed and popup a message box if changes have been detected to confirm if the user wants to save the changes. Obviously the message box is executed using javascript.  But I'd really like to be able to call a method in the code behind of the page which queries the user control if it has changed.  Is there a way of calling the code behind method from within a javascript function? Otherwise, if I make all the functions execut...

How to call a javascript function from an aspx page?
Hi ! A simple question. Which is the right way to call a javascript function into an aspx page? Now I do it thus: <form id="form1" onSubmit="return valForm1()" runat="server"> </form> But I think that is not correct. Isn' t it? Cèsar it is right. your aspx code is executed on the server & java script code on the client. <form id="form1" onSubmit="return valForm1();" runat="server"> </form> AmitThanks & Regards,Amit Batra Ok Amit, thanks !Cèsar...

calling function from javascript in aspx page
 i have many functions in javascript to call these in aspx page Hi ,   Check this link :                        Just like you would any function not in a JavaScript file <script type="text/javascript"><!--callSomeFunctionInJavaScriptFile();// --></script> Are you having a problem? NC......

error in calling javascript function :( from .aspx page
i hv aspx page like <script language ="javascript">   function newwindow(){"mypage.aspx?id=" + document.getElementById('lblid').value); } </script>and in UI code i have one imagebutton with onclick event onclick="newwindow();"i think it should work but dont know why i am getting the following error :Compiler Error Message: BC30456: 'newwindow' is not a member of 'mypage_aspx'.please help you need to add it from the code behindbtnId.Attributes.Add("onclick","newwindow();return false;") | Twitter epascarello | LinkedI...

function call inside aspx page for function in code behind not executing?
Hi,  I converted an .NET 1.1 web application to .NET 2.0 framework.The original .NET 1.1 page runs fine. The webpage has a datagrid, when a label control tries to be populated by a null value I get the following error:Conversion from type 'DBNull' to type 'Date' is not valid. the code on the aspx page: <asp:Label id="Label1" runat="server">        <%# AppDateFormat(DataBinder.Eval(Container, "DataItem.start_Date")) & " - " & AppDateFormat(DataBinder.Eval(Container,...

calling javascript function on aspx page from somefunction in code behind
can i call a javascript function on aspx page from somefunction in code behind like say CodeBehindFunction() { x =a; ............. ................ ................. myJSFuncOnaspxPage(); } thanks red Add this code where you want to invoke the function Me.RegisterStartupScript("KEY", "<script language=""JavaScript"">" & vbCrLf & _ vbTab & " myJSFuncOnaspxPage(); " & vbCrLf & "</script>") ...

how to call Datagrid onblur function in our aspx page using javascript
    hi,  i want to calculate the datagrid inside textbox total value  by calling javascript onblur function... thanks in advance     in code behind...add this...  protected void Page_Load(object sender, EventArgs e) {  if ((this.Request.Params["__EVENTARGUMENT" ] == "DataGrid_OnBlur(Sender, e)")) { DataGrid_OnBlur(Sender, e); } }       ================ in javascript __doPostBack('', 'DataGrid_OnBlur'); where DataGrid_OnBlur is the name of the server side function ..... Ch...

Call javascript function from a server function
Hi, I have as server button on the page and onclick i am calling a server function (check()) In between the function how to call the javascript function <script runat=server> Function check() Some code here ************* CALL JAVASCRIPT FUNCTION HERE************ End Function </script> Can any one help me please Thanks Why do you need to call the javascript. Can't you implement javascript's logic in your language(VB)? Also, javascript can be server or client side. Problem is, you cannot use both Javascript and VB as the server script so you...

Call javascript function from VB function?
Can I call a javascript function from inside a VB function/sub? I would like to call a javascript function that refreshes the parent page after a record has been inserted into a database. I have the javascript function I just dont know how to call it from a vb function/sub?  Any help would be awsome  You can't call client methods from server code, only the other way around. Unless your insert is a very long operation, the best idea is just to do the insert as normal. i.e. perform the insert on postback, then allow the page markup to render as normal.My Blog   captai...

Call c# function from javascript function
This is my code: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <%@ Import Namespace="System.Web.Services" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head runat="server"> <title>Untitled Page</title> <script runat= server> [WebMethod] public string GetName() { return "Hello Word"; } </script> <script language=javascript type="text/javascript">...

calling c# function in javascript function
I'm trying to call a c# function in my javascript function that I use as a buttons OnClientClick. The c# function simply changes some session variable values. The problem I'm having is that everytime my page posts back the c# function that is called within my javascript function is executing, and the only time it should execute is when the button is pressed. I'm not sure what I'm doing wrong but heres my code: <script type="text/javascript"> function Go() { <%SetDefault(); %>'','mywindow4','scrollbars=yes,l...

Call a javascript function that returns a value from a master page in .net 2.0
I an trying to get a value from an XSLT file and assign it to a .net hidden input field XSLT: <xsl:attribute name ="onclick">GetId('<xsl:value-of select="@MasterNavLink" />');</xsl:attribute> Javascript on MasterPage var LinkId = null; function GetId(fldVal) {          //fldVal is set when this function is called in the xslt file    try   {  LinkId = fldVal;             document.getElementById('<%= linkIdIF.ClientID%>').value=fldV...

calling a javascript function from a c# function
Hi,I'm using, c# framwork 1.1 and some javascript.I have a table in which there are 3 cells.In each cell there is a control.In the first cell the control ID is DropDownList1 and the items are Item1, Item2 and Item3.In the second cell, the control ID is TextBox2.In the third cell, the control ID is TextBox3.What i am trying to do is :If DropDownList1 selected value equal Item1   then hide the second AND the third cells.If DropDownList1 selected value equal Item2   then show the second cell AND hide the third cell.If DropDownL...

Calling a javascript function in the content page from the master page.
I have an <asp:Menu on a master page and for one of the menuItems navigation url I can use 'javascript:myfunction()' to call a javascript function in the master page. No problem. Now, what I need to do is use that same master page <asp:menu menuItem to call a javascript function in the content page. Does anyone know how I can call a javascript function located in the content page from the master page using an <asp:Menu menuItem navigation url located on the master page? Thanks,   Steve HI On the content page load u need to find the master page ...

Web resources about - Call a javascript function from a report, the function is in aspx page -

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript SDK - Facebook-Entwickler
Overview The JavaScript SDK provides a rich set of client-side functionality for accessing Facebook...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken .… ...

Resources last updated: 1/5/2016 5:17:46 AM