WebViewer加载报表,如何隐藏工具栏
Web进行报表展示,使用WebViewer加载报表,有时候会有这样的需求就是需要隐藏工具栏,下面就来使用代码层,进行工具栏的的设置。实现代码:
function hide() {
var viewModel = GetWebViewer('WebViewer1');
viewModel.toolbar.toggle(false);
viewModel.sidebar.toggle(false);
};具体代码:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication001.WebForm1" %>
<%@ Register assembly="GrapeCity.ActiveReports.Web" namespace="GrapeCity.ActiveReports.Web" tagprefix="ActiveReportsWeb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
function viewer_loaded() {
var viewModel = GetWebViewer('WebViewer1');
viewModel.toolbar.toggle(false);
viewModel.sidebar.toggle(false);
};
function document_onload() {
$('#WebViewer1').ready(viewer_loaded);
};
</script>
<body onload="document_onload()">
<form id="form1" runat="server">
<div>
<ActiveReportsWeb:WebViewer ID="WebViewer1" runat="server" height="800px" width="1200px" ReportName="file: RdlReport1.rdlx">
</ActiveReportsWeb:WebViewer>
</div>
</form>
</body>
</html>
页:
[1]