我正在尝试使用下面的代码打印我的报告查看器报告,我收到一个错误,即 Microsoft JScript 运行时错误:无法获取属性“get_isLoading”的值:对象为空或未定义。有任何想法吗?
<script language="javascript">
function PrintReport() {
var viewerReference = $find("ReportViewer1");
var stillonLoadState = viewerReference.get_isLoading();
if (!stillonLoadState) {
var reportArea = viewerReference.get_reportAreaContentType();
if (reportArea == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) {
$find("ReportViewer1").invokePrintDialog();
}
}
}
</script>