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#代码写得非常朴素,很多语法糖都没有用上 ...
随机推荐
- Dojo: Quick Start
1.Dojo学习地址 2.Dojo快速开始 2.1.Dojo引入 2.2.指定Dojo模块的位置 2.3.模块加载require 3.查找Dom节点 3.1.根据id查找dom节点 3.2.根据c ...
- linux基础知识3_根文件系统详解
文件系统: rootfs:根文件系统 /boot:系统启动相关的文件,如内核.initrd以及grub /dev:设备文件 块设备:随机访问 字符设备:线性访问,按字符为单位 设备号:主设备号(maj ...
- 对C#泛型实例化对像
public class A { } public class B<T> { public static T Get() { //在这一块如何实例化T这个对象呢?如果用default(T) ...
- linux-关机出现Telling INIT to go to single user mode.无法关机
运行/sbin/shutdown now最后显示:Telling INIT to go to single user mode.INIT:Going single userINIT:Sending g ...
- JDBC中的Statement和PreparedStatement的区别
JDBC中的Statement和PreparedStatement的区别
- PHP环境的搭建(Apache)
一,下载XAMPP集成软件包. 二,Apache的安装配置: Apache的安装就点击下一步下一步,默认路径在系统的C盘. 三,在star Apache的时候,出现了端口号80冲突(被占用),解决 ...
- [LeetCode] Duplicate Emails 重复的邮箱
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- [LeetCode] Maximum Product Subarray 求最大子数组乘积
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
- [LeetCode] Linked List Cycle 单链表中的环
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using ex ...
- ElasticSearch第二步-CRUD之Sense
ElasticSearch系列学习 ElasticSearch第一步-环境配置 ElasticSearch第二步-CRUD之Sense ElasticSearch第三步-中文分词 ElasticSea ...