Asp.net RDLC如何打印报告-一次用于多个记录的相同格式 [英] Asp.net RDLC How to Print a report - same format for multiple records at once

查看:126
本文介绍了Asp.net RDLC如何打印报告-一次用于多个记录的相同格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为PayslipData的表.我创建了一个报告,该报告为特定月份的员工打印工资单.该报告仅适用于单名员工.现在,我想单击所有按钮即可打印所有员工的工资单.这意味着我准备的RDLC格式应打印所有这些工资单
依次显示所有这些工资单,然后在reportviewer中将它们显示在彼此下面,以便我可以使用顶部面板上的打印按钮"一次性打印所有这些工资单.我被困在这里很多天了.请帮忙.

我的代码是这样的

I have a table named PayslipData. I have created a report which Prints Payslip for employee for a particular month. The report is working fine for single employee. BUT now I want to print payslips for ALL employees at a single click of a button. That means the RDLC format which I have prepared should print all these payslips
in succession and show all these payslips one below each other in the reportviewer so that I can use Print Button at the top panel to print all these at one go. I am stuck here for many days. Please help.

My code goes like this

ReportViewer1.LocalReport.DataSources.Clear()
          Dim reportDSHeader As New ReportDataSource("DataSet1", ds.Tables(0))
          Dim reportpath As String = "Reports\PayslipPrint.rdlc"            ReportViewer1.LocalReport.ReportPath = reportpath
          ReportViewer1.LocalReport.DataSources.Add(reportDSHeader)
          ReportViewer1.LocalReport.Refresh()


我正在正确地获取整个数据集,但是在显示报告时,它仅显示单个记录.


I am geting the entire dataset properly, but while showing the report, it shows only single record.

推荐答案

Hello vbguy,

我通常要做的只是将报表正文的整个内容(包括标签和所有内容)包装在
Hello vbguy,

What I usually do is just wrap the whole content of the report body(including labels and everything) inside a List[^] element, and then assign the datasource to that list. This will iterate over all the elements of your datasource and you should have your report displaying multiple payslips if your datasource contains more than 1.


您好,rusha007

非常感谢您的帮助.

我尝试过,它对所有记录都重复使用Payslip格式.现在唯一的麻烦是它在所有位置仅显示一个记录的数据.我可能在某处出了问题,或者我认为我需要将分组依据"添加到该列表中吗?

今天将尝试找出问题所在.如果您知道我可能出了问题,请告诉我.

无论如何,我衷心的感谢您的帮助.
Hello andrusha007

Thanks a lot for your kind help.

I tried it and it is repeating that Payslip format for all the records. Only the hitch now is it is showing Data for Only one record at ALL places. I might have goofed up somewhere or I think do I need to add Group By to that list?

Will try to figure out the problem today. If you know where I might be going wrong, then please let me know.

Anyways my hearttfelt thanks for your help.


我在我的项目中正在做同样的事情,唯一需要做的就是将所有内容都放入列表中,并在在清单上.

这对我行得通.

希望这会有所帮助.
I am doing the same thing in my project, only thing you need to do is put everything in a list and one group should be created on employee in on list.

That works for me.

Hope this helps.


这篇关于Asp.net RDLC如何打印报告-一次用于多个记录的相同格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆