VS2005中ReportViewer 本地模式下呈现报表

 

前台代码

  1. <table width="100%" border="0" marginwidth="0" marginheight="0">
  2.             <tr>
  3.                 <td>
  4.                     <rsweb:reportviewer id="RvData" runat="server" Visible="false" Width="100%" Height="500px">
  5.                    </rsweb:reportviewer>
  6.                 </td>
  7.             </tr>
  8.             </table>

后台代码

  1.  DataSet ds=new DataSet();
  2.         ds = LogicLayer.GetJjAccount(Department, Unit);
  3.         RvData.Visible = true;
  4.         RvData.LocalReport.ReportPath = "../AccountWeb/Reports/JJ_Report.rdl";
  5.         ReportParameter unitCode = new ReportParameter("unitCode", Unit);
  6.         ReportParameter routePoint = new ReportParameter("RoutePoint", departmentkey);
  7.         RvData.LocalReport.SetParameters(new ReportParameter[] { unitCode, routePoint });
  8.       
  9.         
  10.         ReportDataSource rds = new ReportDataSource("JJ_DataSet", ds.Tables[0]);
  11.         
  12.         RvData.LocalReport.DataSources.Clear();
  13.         RvData.LocalReport.DataSources.Add(rds);
  14.         RvData.LocalReport.Refresh();

用代码方式动态加载报表,参数可以是界面上的传递值。报表为reporting service 2005 报表

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值