客户端SSRS调用

VS2010中需添加:  <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> 否则不能运行。

前台:

 
  
1 <% @ Register Assembly = " Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a "
2 Namespace = " Microsoft.Reporting.WebForms " TagPrefix = " rsweb " %>
3
4   <! DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
5
6   < html xmlns = " http://www.w3.org/1999/xhtml " >
7   < head runat = " server " >
8 < title ></ title >
9 </ head >
10 < body >
11 < form id = " form1 " runat = " server " >
12 < div >
13 < asp:ScriptManager ID = " ScriptManager1 " runat = " server " >
14 </ asp:ScriptManager >
15 < rsweb:ReportViewer ID = " rpvDemo " runat = " server " Font - Names = " Verdana "
16 Font - Size = " 8pt " InteractiveDeviceInfos = " (集合) " WaitMessageFont - Names = " Verdana "
17 WaitMessageFont - Size = " 14pt " >
18 < LocalReport ReportPath = " Report1.rdlc " >
19 < DataSources >
20 < rsweb:ReportDataSource DataSourceId = " ObjectDataSource1 " Name = " DataSet1 " />
21 </ DataSources >
22 </ LocalReport >
23 </ rsweb:ReportViewer >
24 < asp:ObjectDataSource ID = " ObjectDataSource1 " runat = " server "
25 SelectMethod = " GetData "
26 TypeName = " WebApplication1.db_WebDemoDataSetTableAdapters.WebDemo_UserInfoTableAdapter " >
27 </ asp:ObjectDataSource >
28 </ div >
29 </ form >
30 </ body >
31 </ html >
32

 

 

后台:

 

 
  
1 using System;
2 using System.Collections .Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.UI;
6 using System.Web.UI.WebControls;
7 using Microsoft.Reporting.WebForms;
8 using WebApplication1.db_WebDemoDataSetTableAdapters;
9
10 namespace WebApplication1
11 {
12 public partial class WebForm1 : System.Web.UI.Page
13 {
14 protected void Page_Load( object sender, EventArgs e)
15 {
16 if ( ! IsPostBack)
17 {
18 this .rpvDemo.ShowPrintButton = false ; // 隐藏页面的“打印”按钮
19 this .rpvDemo.ProcessingMode = ProcessingMode.Local; // 设置处理模式为当地
20 this .rpvDemo.LocalReport.ReportPath = " Report1.rdlc " ; // 获取本地报表的路径
21 ReportDataSource ds = new ReportDataSource(); // 构造数据源
22 ds.Name = " DataSet1 " ; // 获取报表的数据源名称
23 ds.Value = new WebDemo_UserInfoTableAdapter().GetData(); // 获取报表的值
24 this .rpvDemo.LocalReport.DataSources.Add(ds); // 添加数据源
25 }
26 }
27 }
28 }

 

 

 

转载于:https://www.cnblogs.com/gyweiUSTC/articles/1893753.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值