Webform下开发rdlc报表实现钻取功能!
来源:互联网 发布:表格含公式,数据透视表 编辑:程序博客网 时间:2024/05/27 00:30
Webform下开发rdlc报表实现钻取功能!
2009-10-22 20:06:08| 分类:C#.net | 标签:|字号大中小 订阅
参考了蜡人张的blog
http://www.cnblogs.com/waxdoll/archive/2006/06/23/434215.html
学着做了一下rdlc Drillthrough报表,但用winform的方法始终不能在webform中成功,点击链接后提示没有为"主报表的数据源"提供数据源实例,解决方法是需要在drillthrough事件函数中再绑定一次主表数据源...
CustomerInfo GI = new CustomerInfo();
DataSet ds = new DataSet();
private DataTable LoadEmployeesData()
{
string strConn = ConfigurationManager.AppSettings["ConnectionString"].ToString(); ;
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string strSql = "select * from tb_CustomerAnswer ";
SqlCommand cmd = new SqlCommand(strSql, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds,"1");
conn.Close();
return ds.Tables["1"];
}
private DataTable LoadDepartmentsData()
{
string strConn = ConfigurationManager.AppSettings["ConnectionString"].ToString(); ;
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string strSql = "select * from tb_CustomerInfo ";
SqlCommand cmd = new SqlCommand(strSql, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds,"2");
conn.Close();
return ds.Tables["2"];
}
protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{
LocalReport Report = (LocalReport)e.Report;
Report.DataSources.Add(new ReportDataSource("dsCustomerInfo_tb_CustomerAnswer",
LoadEmployeesData()));
Report.DataSources.Add(new ReportDataSource("dsCustomerInfo_tb_CustomerInfo",
LoadDepartmentsData())); //这里是必须的,浪费了好长时间
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Supply a DataTable corresponding to each report da
ReportViewer1.LocalReport.ReportPath = Server.MapPath("rptCustomerInfo.rdlc");
ReportViewer1.LocalReport.DataSources.Add(
new ReportDataSource("dsCustomerInfo_tb_CustomerInfo", LoadDepartmentsData()));
}
ReportViewer1.Drillthrough += new DrillthroughEventHandler(ReportViewer1_Drillthrough);
}
- Webform下开发rdlc报表实现钻取功能!
- RDLC使用手册_RDLC钻取功能实现 (RDLC之一)
- RDLC使用手册_RDLC钻取功能实现
- aspx+rdlc实现报表功能
- RDLC子报表钻取
- rdlc报表 打印图片功能如何实现
- RDLC报表实现二维码打印功能
- RDLC报表钻取空白页问题
- C# 实现 RDLC 自定义报表
- rdlc 报表实现百分比显示
- RDLC报表上下标实现
- WebForm开发中的路由功能
- asp.net RDLC 报表开发详解
- RDLC报表
- RDLC报表
- RDLC报表
- RDLC报表
- RDLC报表
- 黑马程序员_银行调度系统
- 你是想读书,还是想读完书?
- 程序员_Java初级<二> 关键字、标识符、运算符、进制
- Java IO中的对象流之一次读入多个对象
- 正数转化为字符串
- Webform下开发rdlc报表实现钻取功能!
- KMP之求最大周期数
- java格式化输出 JAVA String.format 方法使用介绍
- Java面试汇总
- arm-linux-gcc/ld/objcopy/objdump使用总结
- 问题六十二: (打印字母游戏)打印字母"V".
- 【设计模式】之二十二Prototype
- 用Pthreads进行共享内存编程----HelloWorld
- onSaveInstanceState和onRestoreInstanceState触发的时机