ReportingServies报表开发实例教程
来源:互联网 发布:无痛人流价格 知乎 编辑:程序博客网 时间:2024/06/07 00:34
文章目录
ReportingServies报表开发实例教程
ReportingServies——SQLServer报表开发综合实例效果图如下:
1、我们先完成sql语句的编写,以下是各表和关键字段:
--t:hx_t_waterusedamount--用水水量 hx_t_waterusedamountid
--f:hx_frecorder(抄表员),hx_fzone(区段),hx_fmeterid(水表),hx_fpayamount(结算水量),hx_fdepartmentid(收费部门)
--t:hx_t_receivable--应收水费
--f:hx_fcollchargesreceivable4(污水处理费),hx_freceivablefee(应收水费),hx_fusedamountid(水量信息)
--hx_fstate(水量状态计划:100000000),
--hx_frecordtype(抄表类型):正常,000,000 估水,000,001 未抄见,000,002
--hx_festimateamountreason(估水原因):不用水,000,000 无表,000,001 防冻,000,002 表停,000,003
--hx_fnotrecordreason(未抄见原因):未见表,000,000 有水,000,001 表埋,000,002 锁门,000,003 表不清,000,004
--hx_freading(本次抄表止度)
以下是SQL正文:
declare @begin_date datetimedeclare @end_date datetimeselect @begin_date = getdate()--count(w.hx_t_waterusedamountid) as '应抄表数',declare @hx_ClosingAccountInfoId uniqueidentifierset @hx_ClosingAccountInfoId='08AFEF9F-E174-46F2-855A-32F26BE38F3B'declare @BusinessunitId uniqueidentifierset @BusinessunitId='6FE6FE55-5945-E411-9402-6CAE8B22702D'-----------------SQL正文----------------------------------------------------------执行时间:declare @FMonth intdeclare @FYear intselect @FYear=t.hx_FYear,@FMonth=t.hx_FMonth from hx_ClosingAccountInfo t where hx_ClosingAccountInfoId=@hx_ClosingAccountInfoId--select @FYear,@FMonthif @BusinessunitId is nullbeginselect s.fullname fullname,w.hx_fzone hx_fzone,1 as AllCounts,case when w.hx_frecordtype='100000000' then 1 else 0 end Normal,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000000' then 1 else 0 end NotUseWater,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000001' then 1 else 0 end NoMeterWater,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000002' then 1 else 0 end antifreeze,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000003' then 1 else 0 end MeterStop,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason not in('100000000','100000001','100000002','100000003') then 1 else 0 end OtherWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000000' then 1 else 0 end NotSeeMeterWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000001' then 1 else 0 end HaveWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000002' then 1 else 0 end MeterWaterBuried,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000003' then 1 else 0 end LockDoor,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000004' then 1 else 0 end MeterWaterFuzzy,case when w.hx_freading is null then 1 else 0 end hx_freading,w.hx_fpayamount hx_fpayamount,r.hx_freceivablefee hx_freceivablefee,r.hx_fcollchargesreceivable4 hx_fcollchargesreceivable4from hx_t_waterusedamount w inner join hx_t_receivable ron w.hx_t_waterusedamountid=r.hx_fusedamountid and w.hx_frecorder is not null and w.hx_fstate='100000006' and w.hx_FYear=@FYear and w.hx_FMonth=@FMonth --andinner join systemuser s on w.hx_frecorder=s.systemuseridendelsebeginselect s.fullname fullname,w.hx_fzone hx_fzone,1 as AllCounts,case when w.hx_frecordtype='100000000' then 1 else 0 end Normal,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000000' then 1 else 0 end NotUseWater,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000001' then 1 else 0 end NoMeterWater,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000002' then 1 else 0 end antifreeze,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason='100000003' then 1 else 0 end MeterStop,case when w.hx_frecordtype='100000001' and w.hx_festimateamountreason not in('100000000','100000001','100000002','100000003') then 1 else 0 end OtherWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000000' then 1 else 0 end NotSeeMeterWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000001' then 1 else 0 end HaveWater,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000002' then 1 else 0 end MeterWaterBuried,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000003' then 1 else 0 end LockDoor,case when w.hx_frecordtype='100000002' and w.hx_fnotrecordreason='100000004' then 1 else 0 end MeterWaterFuzzy,case when w.hx_freading is null then 1 else 0 end hx_freading,w.hx_fpayamount hx_fpayamount,r.hx_freceivablefee hx_freceivablefee,r.hx_fcollchargesreceivable4 hx_fcollchargesreceivable4from hx_t_waterusedamount w inner join hx_t_receivable ron w.hx_t_waterusedamountid=r.hx_fusedamountid and w.hx_fdepartmentid=@BusinessunitId and w.hx_frecorder is not null and w.hx_fstate='100000006' and w.hx_FYear=@FYear and w.hx_FMonth=@FMonth --andinner join systemuser s on w.hx_frecorder=s.systemuseridend-----------------------------------------------------------------------------group by s.fullname, w.hx_fzone,w.hx_fpayamount,r.hx_freceivablefee,r.hx_fcollchargesreceivable4select @end_date = getdate()select datediff(ms,@begin_date,@end_date) as '用时/毫秒'--and w.hx_fdepartmentid=@BusinessunitId
2、使用报表开发工具
右键单击解决方案管理器中的报表,选择“新建报表”
由于我们要按照用户名fullname、区段(hxfzone)进行分组统计,我们可以这样设置
这样就可以实现如下效果:
我们可以看到查询条件
这个是从数据库中查询出来的,我们可以通过如下配置来实现
同样,关于查询条件 部门
接下来,要配置查询参数了
最后再配置查询的主数据集
- ReportingServies报表开发实例教程
- ReportingServies——SQLServer报表开发综合实例
- vba开发实例教程
- 开发资料与实例教程
- BlackBerry Java客户端开发项目实例教程一
- BlackBerry Java客户端开发项目实例教程二
- BlackBerry Java客户端开发项目实例教程三
- BlackBerry Java客户端开发项目实例教程四
- Android开发 API人脸检测实例教程
- Pylons架构网站开发入门实例教程
- Flex开发实例教程-Mp3播放器
- PHP+MYSQL会员系统的开发实例教程
- PHP+MYSQL会员系统的开发实例教程
- DWR实例教程开发步骤及注意事项
- U3D游戏开发之MAYA Zbrush实例教程
- WordPress插件开发实例教程 - 版权插件
- WordPress插件开发实例教程 - 版权插件
- SpringMVC与iReport(JasperReports) 整合开发实例教程
- android 面试题
- Linux pppoe拨号 路由配置
- 解决nginx php弹出下载、不解析的问题
- 黑马程序员——JAVA基础之数组
- 解决 -bash:telnet:command not found
- ReportingServies报表开发实例教程
- 从基础程序员到高级程序员的发展之路
- 关于高维超正体(cross-polytope)的性质及其应用
- 智慧的人用心交流,聪明的人用脑沟通,愚蠢的人用嘴说话!
- hdu2058
- cocos2dx 一些知识点收集
- express快速搭建项目
- JAR包查找网站
- Lua标准库 - 基本函数(base function)