ReportView报表开发记录(一)
在公司开发,使用到ReportView技术,写下自己的经验。
1.在工具箱中找到 ReportViewer,ScriptManager放到test.aspx页面。
如果找不到报表项,请参考http://www.cnblogs.com/worf/p/5714455.html

2.添加数据集 DataSet.xsd

在数据集中添加DataTable,添加查询的列,列名要和数据库中的列(字段)对应。
3.添加报表Report.rdlc

4.绑定数据
在这里绑定数据使用的是动态绑定。
private void getDateBind()
{
//获得路径
string req_url = this.Request.Url.ToString();
string currentPath = "";
int pos = req_url.LastIndexOf("/");
if (pos > )
{
currentPath = req_url.Substring(, pos + );//给报表文本框添加url
}
DataSet ds = BuildingDetails.GetIndustryHYData(time1, time2, buildingId, industryId);//从数据库中查询的数据
totalCount.InnerText = ds.Tables[].Rows.Count.ToString();
rvBuildingDetail_IndustryHY.LocalReport.DataSources.Clear();
rvBuildingDetail_IndustryHY.LocalReport.DataSources.Add(new ReportDataSource("BuildingDetail_IndustryHY", ds.Tables[]));
rvBuildingDetail_IndustryHY.AsyncRendering = true;
rvBuildingDetail_IndustryHY.InteractivityPostBackMode = InteractivityPostBackMode.AlwaysSynchronous;
rvBuildingDetail_IndustryHY.ShowToolBar= true;//获取或设置一个指示工具栏在控件上是否可见的值。默认为true
rvBuildingDetail_IndustryHY.LocalReport.EnableHyperlinks = true;//指示在报表包含超链接操作时是否可以呈现
rvBuildingDetail_IndustryHY.HyperlinkTarget = "_self";//在相同的框架中打开被链接文档
rvBuildingDetail_IndustryHY.LocalReport.ReportPath = @"BuildingDetail\rdlc\BuildingDetail_IndustryHY.rdlc";//获取或设置本地报表的本地文件系统路径
rvBuildingDetail_IndustryHY.LocalReport.ReportEmbeddedResource = "BuildingDetail_IndustryHY.rdlc";//获取或设置报表嵌入资源的名称 //设置参数
ReportParameter rpCurrentPath = new ReportParameter("url", currentPath);
ReportParameter rpTime1 = new ReportParameter("time1", time1);
ReportParameter rpTime2 = new ReportParameter("time2", time2);
ReportParameter rpIndustryId = new ReportParameter("industryId", industryId);
ReportParameter rpBuildingId = new ReportParameter("buildingId", buildingId);
rvBuildingDetail_IndustryHY.LocalReport.SetParameters(new ReportParameter[] { rpCurrentPath, rpCurrentPath, rpTime1, rpTime2, rpIndustryId, rpBuildingId });
}
到此,整个流程完成。
ReportView报表开发记录(一)的更多相关文章
- Grid++Report 报表开发工具
Grid++Report 报表开发工具 版本 更新日期 大小 下载 说明 Grid++Repoert6.0.0.6 2015/08/08 16.0M [下载] 锐浪报表工具最新版本,新增功能说 ...
- JasperReport报表开发(一)--原理介绍
1. JasperReport介绍 JasperReport 是一个开源的Java报表引擎,它不像其他的报表工具,例如Crystal报表是基于Java的,没有自己的表达式语法.Jasper Repor ...
- ActiveReport系列报表开发随笔收集
转自:博客园 http://www.cnblogs.com/dahuzizyd/archive/2007/04/11/ActiveReport_All.html 使用ActiveReport for ...
- JFinal使用笔记3-注册和登录功能开发记录
首页 开源项目 问答 代码 博客 翻译 资讯 移动开发 招聘 城市圈 当前访客身份:游客 [ 登录 | 加入开源中国 ] 当前访客身份: 游客 [ 登录 | 加入开源中国 ] 软件 土龙 关注 ...
- CozyRSS开发记录22-界面退化
CozyRSS开发记录22-界面退化 1.问题1-HtmlTextBlock 找的这个HtmlTextBlock有很严重的bug,有时候显示不完全,有时候直接就崩了.然后看了下代码,完全是学生仔水平写 ...
- CozyRSS开发记录21-默认RSS源列表
CozyRSS开发记录21-默认RSS源列表 1.默认列表 在第一次使用CozyRSS的情况下,我们让它内置五个RSS源吧: 2.响应RSS源的更新 先不处理RSS源列表项的点击,响应下下拉菜单里的更 ...
- CozyRSS开发记录20-CanResizeWithGrip
CozyRSS开发记录20-CanResizeWithGrip 1.窗口样式 首先,WindowStyle有四种: 然后,对于窗口缩放的ResizeMode,也有四种,CanResize和CanRes ...
- CozyRSS开发记录19-窗口标题栏交互
CozyRSS开发记录19-窗口标题栏交互 1.谈谈对mvvm解耦的看法 在使用mvvm时,如何操作窗口,这是一个问题.这个问题的关键点是:mvvm是把view和viewmodel解耦了的,很多写法一 ...
- CozyRSS开发记录18-番外之Atom1.0的支持
CozyRSS开发记录18-番外之Atom1.0的支持 1.对CozyRSS.Syndication批判一番 由于我工作的主要开发语言是c++,所以会看到我的c#代码写得非常朴素,很多语法糖都没有用上 ...
随机推荐
- SQL Server查询第31到40条数据
大致分为两种情况:ID连续和ID不连续. 1.ID连续的情况: 2.ID不连续的情况: (1).两次对表查询,效率较低. ID from A) (2).外层查询没有对表A进行查询,效率提高. ID f ...
- 0034 Java学习笔记-反射-初步2-操作对象
通过反射创建对象 通过反射创建对象有两种方式,一种通过Class对象的newInstance()方法,一种是获取到Class对象的Constructor后,再调用newInstance()方法,前者要 ...
- 搭建php环境哪家强
http://www.bubuko.com/infodetail-791030.html
- Dipole Antenna : 2
Characteristics of dipole antenna. %% % characteristics of dipole antenna % author : Leon % email:ya ...
- Django基础之wsgi
Django 一 什么是web框架 框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统,简单地说,就是你用别人搭建好的舞台来做表演 ...
- servlet过滤器使用
servlet的过滤器夹在用户和servlet之间,可以截获并预处理或者打断{用户到servlet的请求或servlet到用户的响应},但本身并不能处理和响应用户请求. filter类必须实现Filt ...
- [LeetCode] Partition Equal Subset Sum 相同子集和分割
Given a non-empty array containing only positive integers, find if the array can be partitioned into ...
- [LeetCode] Nim Game 尼姆游戏
You are playing the following Nim Game with your friend: There is a heap of stones on the table, eac ...
- Netty学习笔记之一(Netty解析简单的Http Post Json 请求)
一,HTTP解码器可能会将一个HTTP请求解析成多个消息对象. ch.pipeline().addLast(new HttpServerCodec()); ch.pipeline().addLast( ...
- TypeScript 2.0候选版(RC)已出,哪些新特性值得我们关注?
注:本文提及到的代码示例下载地址 - Runnable sample to introduce Typescript 2.0 RC new features 作为一个Javascript的超集, Ty ...