ReportViewer JavaScript API
JavaScript API
One of the new features we added to the ASP.Net Report Viewer in Visual Studio 2010 is a JavaScript API to allow you to interact with the viewer on client. In reading many of the posts on the report controls forum, we found that many people struggle when implementing a custom toolbar or replacing portions of the toolbar functionality. The new JavaScript API is intended to make it easier for you to provide the same functionality available through the built-in toolbar with a minimum amount of effort.
The JavaScript API is exposed through the client side ReportViewer object. Specifically, it’s the Microsoft.Reporting.WebFormsClient.ReportViewer class. An instance of this class is created on the client for each instance of the ReportViewer control on the page.
Referencing the client side viewer
The ReportViewer client side object inherits from Sys.UI.Control. To obtain a reference to the client side viewer, use the $find method as follows:
var clientViewer = $find("ReportViewer1");
The identifier you pass to $find corresponds to the ClientID of the ReportViewer server control.
Checking the state of the viewer
Once you have a reference to the client side viewer, you will want to check the state of the viewer before invoking most of the various methods and properties it exposes. When the viewer is in a loading state, most of the functionality of the client viewer is unavailable and will throw an exception if called. The viewer is loading whenever an asynchronous postback is in progress. It is also in the loading state while retrieving a report page. This usually happens during an asynchronous postback, but can also extend beyond the lifetime of the postback, such as while retrieving images displayed on the report page. To check the state of the viewer, use the isLoading property:
var isLoading = clientViewer.get_isLoading();
Once you have dete
相关文档:
javascript调用父窗口(父页面)的方法
window.parent与window.opener的区别 javascript调用主窗口方法
1: window.parent 是iframe页面调用父页面对象
举例:
a.html
Html代码
<html>
<head><title>父页面</title></head> &nb ......
JavaScript基础
stringObject.charAt(index)方法:返回指定索引位置处的字符。
stringObject.slice(start,[end])和stringObject.substring(start,[end])方法都接受两个参数,分别为子字符串的起始位置和终止位置,返回这两者之间的字符串,不包括终止位置的那个字符串。如果不指定第二个参数,则默认为字符串的长度,即 ......
(一).确认删除用法:
1. BtnDel.Attributes.Add("onclick","return confirm('"+"确认删除?"+"')");
2. linktempDelete.Attributes["onclick"]="javascript:return confirm('"+"确认删除?"+"');";
3. privat ......
function QueryString(fieldName){
var urlString = location.search;
if (urlString != null) {
var typeQu = fieldName + "=";
var urlEnd = urlString.indexOf(typeQu);
if (urlEnd != -1) {
var paramsUrl = urlString.substring(urlEnd + typeQu.length);
var isEnd = paramsUrl.indexOf('&' ......