原文: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报表本地加载的使用的更多相关文章

  1. 打开visual studio 2010报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包

    1  解决: 运行cmd 2  输入:regsvr32 %windir%\system32\jscript.dll

  2. Visual Studio 2008 Package Load Failure:未能正确加载包“Microsoft.VisualStudio.Xaml”

    在安装好Visual Studio 2008后,启动Visual Studio 2008 发现如下提示: 包加载失败 未能正确加载包“Microsoft.VisualStudio.Xaml”( GUI ...

  3. Visual Studio的NuGet包管理器无法加载

    由于网络原因,虽然地址http://www.nuget.org和https://www.nuget.org/api/v2/在浏览器可以正常打开,但是在VS中使用默认的NuGet程序包源经常加载不出来, ...

  4. 打开Visual Studio 2017报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包

    出现如下错误 解决办法 > cmd > regsvr32 %windir%\system32\jscript.dll

  5. 水晶报表初体验(Visual Studio 2010)

    安装水晶报表后如下使用: 配置rpt文件,如图 前台(Asp.net页面): <%@ Register Assembly="CrystalDecisions.Web, Version= ...

  6. Visual Studio 2010打开水晶报表是出现二进制

    水晶报表在64位的机器下未安装成功 解决方法 到http://www.cnblogs.com/siyunianhua/p/4806513.html下载  水晶报表VS2010版IDE安装标准版SAP ...

  7. Visual Studio 2010 SP1 在线安装后,找到缓存在本地的临时文件以便下次离线安装

    由于在下载Visual Studio 2010安装程序(大约3G左右)的时候速度飞快,大约几分钟下载完毕(多线程下载工具下载),所以笔者在继续安装Visual Studio 2010 SP1的时候也选 ...

  8. Visual Studio 2010 RDLC 报表简单使用

    原文:Visual Studio 2010 RDLC 报表简单使用 RDLC(Report Definition Language Client-side Processing)是Visual Stu ...

  9. 使用Visual Studio下自带的SQL Server Express

    软件环境:Windows7(x64) + Visual Studio 2010 + SQL Server Express 2008 1.配置数据库 装VS2010不小心把自带的SQL Server 2 ...

随机推荐

  1. Java中的continue语句——通过示例学习Java编程(12)

    作者:CHAITANYA SINGH 来源:https://www.koofun.com//pro/kfpostsdetail?kfpostsid=23 continue语句主要是用在循环代码块中.当 ...

  2. AJPFX总结java创建线程的三种方式及其对比

    Java中创建线程主要有三种方式: 一.继承Thread类创建线程类 (1)定义Thread类的子类,并重写该类的run方法,该run方法的方法体就代表了线程要完成的任务.因此把run()方法称为执行 ...

  3. 会话跟踪之Session

    Session是服务端使用记录客户端状态的一种机制,Session使用简单,但是和Cookie相比,增加了服务器的存储压力[因为为了追求速度,服务器将Session放置在了内存中].Cookie是保存 ...

  4. 使用JS实现图片轮播(前后首尾相接)

    最近各种跑面试,终于还是被问到这个,一脑子浆糊,当时没想出来首尾相接怎么搞,回来之后研究了一波,终于搞出来了,不多说,直接看代码 代码参考了一位已经写好了图片轮播功能的(在此表示感谢),但是没有首尾相 ...

  5. (已解决)Arduino mega2560 R3插在电脑上没有反应

           OK,话不多说.网上找了一些资料,感觉都说的不够清晰.自己琢磨了下,有了一个简单粗暴的方法. 步骤1:插上Arduino mega2560板子.没有反应. 步骤2:我的电脑-管理-设备管 ...

  6. EPSG:4326

    简单说,"EPSG:4326"指的就是WGS84坐标系 参考 http://blog.csdn.net/cloverwindy/article/details/8663968 AU ...

  7. 模块详解及import本质

    一.模块的定义 用来从逻辑上组织python代码(变量,函数,类,逻辑:实现一个功能) 本质就是.py结尾的Python文件(文件名test.py,对应的模块名:test) 包:用来从逻辑上组织模块的 ...

  8. bt5 r3下metasploit连接postgresql数据库

    一.查看PostgreSQL使用的端口,默认为7337 #: netstat -tnpl |grep postgres 二.查看Msf配置,里面有默认的用户名和密码 默认配置文件:/opt/metas ...

  9. Mantis-1.3.3 (Ubuntu 16.04)

    平台: Ubuntu 类型: 虚拟机镜像 软件包: mantis-1.3.3 bug tracking commercial devops mantis open-source project man ...

  10. 使用后台程序的第一个表单Form

    参考手册:http://www.yiichina.com/doc/guide/2.0/start-forms 1.创建模型:advanced\backend\models\moxing.php 此模型 ...