visual studio 2010 自带reporting报表本地加载的使用
原文:visual studio 2010 自带reporting报表本地加载的使用
在这家公司时间不长,接触都是之前没玩过的东东,先是工作流引擎和各种邮件短信的审核信息,后又是部署reporting服务器。
reporting服务部署就不在这多说,在vs2010里面是自带了reporting报表的直接添加就可以使用。如图

这是一个空白的模板。这时模板已有了就差数据了在新加一个数据集DataSet

数据集有了模板有了就回到reporting模板页在这上面设计格式了,在空白处 右键-插入-表(也可以是其他图表之类)选择数据源

此时的报表模板就和绑定web控件一样设定对于字段

到这模板设定就完成了。接着去写对应的加载页面了aspx的html如下
<rsweb:ReportViewer ID="rvReport" runat="server" Font-Names="Verdana"
Font-Size="8pt" WaitMessageFont-Size="14pt" InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana"
Width="100%" Height="90%">
<LocalReport ReportPath="ReportFiles\RepairCountReport.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1"/>
</DataSources>
</LocalReport> </rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server">
</asp:ObjectDataSource>
在cs文件加载数据代码如下
private void InitDataGrid()
{
string betweenBegin = BetweenBegin.Value;
string betweenEnd = BetweenEnd.Value;
if (string.IsNullOrWhiteSpace(betweenBegin) || string.IsNullOrWhiteSpace(betweenEnd))
{
PromptHelper.ShowMessageJbox("温馨提示", "请输入查询区间", this);
return;
}
//默认是选中即油站名称进行分组
string groupbyValue = "";
if (ckOuName.Checked)
{
groupbyValue = "1";
}
else
{
groupbyValue = RadioButtonList1.SelectedValue;
}
sqlWhere = " and (T1.ActualFinishDate BETWEEN '" + betweenBegin + "' AND '" + betweenEnd + "') ";
string ouName=OUName.Value;
if (!string.IsNullOrWhiteSpace(ouName) && ouName != "油站名称")
{
sqlWhere += " and T3.OUName like '%" + ouName + "%'";
}
//先获取数据
SqlHelper helper = new SqlHelper();
SqlParameter[] par = new SqlParameter[]{
new SqlParameter("@sqlWhere",SqlDbType.VarChar,1000),
new SqlParameter("@groupby",SqlDbType.VarChar,2)
};
par[0].Value = sqlWhere;
par[1].Value = groupbyValue;
DataSet DataSet1 = helper.ExecuteDataSet(CommandType.StoredProcedure, "proc_RepairCountReport", par);
this.rvReport.Visible = true; this.rvReport.LocalReport.DataSources.Clear(); ObjectDataSource1.SelectParameters.Clear();
ObjectDataSource1.SelectParameters.Add("sqlWhere", sqlWhere);
this.rvReport.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", DataSet1.Tables[0]));
this.rvReport.LocalReport.Refresh(); }
到这就算整个报表都已经做完了看看效果吧

visual studio 2010 自带reporting报表本地加载的使用的更多相关文章
- 打开visual studio 2010报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包
1 解决: 运行cmd 2 输入:regsvr32 %windir%\system32\jscript.dll
- Visual Studio 2008 Package Load Failure:未能正确加载包“Microsoft.VisualStudio.Xaml”
在安装好Visual Studio 2008后,启动Visual Studio 2008 发现如下提示: 包加载失败 未能正确加载包“Microsoft.VisualStudio.Xaml”( GUI ...
- Visual Studio的NuGet包管理器无法加载
由于网络原因,虽然地址http://www.nuget.org和https://www.nuget.org/api/v2/在浏览器可以正常打开,但是在VS中使用默认的NuGet程序包源经常加载不出来, ...
- 打开Visual Studio 2017报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包
出现如下错误 解决办法 > cmd > regsvr32 %windir%\system32\jscript.dll
- 水晶报表初体验(Visual Studio 2010)
安装水晶报表后如下使用: 配置rpt文件,如图 前台(Asp.net页面): <%@ Register Assembly="CrystalDecisions.Web, Version= ...
- Visual Studio 2010打开水晶报表是出现二进制
水晶报表在64位的机器下未安装成功 解决方法 到http://www.cnblogs.com/siyunianhua/p/4806513.html下载 水晶报表VS2010版IDE安装标准版SAP ...
- Visual Studio 2010 SP1 在线安装后,找到缓存在本地的临时文件以便下次离线安装
由于在下载Visual Studio 2010安装程序(大约3G左右)的时候速度飞快,大约几分钟下载完毕(多线程下载工具下载),所以笔者在继续安装Visual Studio 2010 SP1的时候也选 ...
- Visual Studio 2010 RDLC 报表简单使用
原文:Visual Studio 2010 RDLC 报表简单使用 RDLC(Report Definition Language Client-side Processing)是Visual Stu ...
- 使用Visual Studio下自带的SQL Server Express
软件环境:Windows7(x64) + Visual Studio 2010 + SQL Server Express 2008 1.配置数据库 装VS2010不小心把自带的SQL Server 2 ...
随机推荐
- CF1152C Neko does Maths
思路: 假设a <= b,lcm(a + k, b + k) = (a + k) * (b + k) / gcd(a + k, b + k) = (a + k) * (b + k) / gcd( ...
- node安装启动服务
一.下载安装包: node下载地址:https://nodejs.org/en/download/,根据自己电脑的配置下载相应的windows64位安装包,下载完成后,进行安装.下面我用的8.9.0版 ...
- HDU 1059 Dividing 分配(多重背包,母函数)
题意: 两个人共同收藏了一些石头,现在要分道扬镳,得分资产了,石头具有不同的收藏价值,分别为1.2.3.4.5.6共6个价钱.问:是否能公平分配? 输入: 每行为一个测试例子,每行包括6个数字,分别对 ...
- JavaScript:理解worker事件api
如果你不是很了解Event事件,建议先看我上一篇随文javascript:理解DOM事件.或者直接看下文worker api. hack 首先,我们需要实例一个Worker的对象,浏览器会根据新创建的 ...
- Javascript 向量
向量 既有大小又有方向的量叫做向量(亦称矢量),与标量相对,用JS实现代码如下,直接搬miloyip的了 Vector2 = function(x, y) { this.x = x; this.y = ...
- Handling Exceptions
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Exceptions/Tasks/Handling ...
- 关于profile集合
profile集合是mongodb的慢操作日志 > db.getProfilingStatus() { , , } 可以通过getProfilingStatus来查看当前profile设置 pr ...
- CUDA:Supercomputing for the Masses (用于大量数据的超级计算)-第二节
原文链接 第二节:第一个内核 Rob Farber 是西北太平洋国家实验室(Pacific Northwest National Laboratory)的高级科研人员.他在多个国家级的实验室进行大型并 ...
- 阿里云服务器下安装LAMP环境(CentOS Linux 6.3) 安装与配置 Apache 服务
想让我们的阿里云服务器成为一台 Web 服务器,我们需要安装一个 Web 服务器软件,比如 Apache ,或者 Nginx 等等.下面我们就一起来安装一个 Apache 服务. 我们可以使用 yum ...
- 基于 Nginx && Lua 的简易CC防护方案
零.前言 1.CC攻击简述 CC攻击(Challenge Collapsar)是常见网站应用层攻击的一种,目的是消耗服务器资源,降低业务响应效率:极端情况会让站点无法正常提供服务: 2.本文要点 旨在 ...