将水晶报表分成单个页面 [英] spliting the crystal report into a single page

查看:81
本文介绍了将水晶报表分成单个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经为员工工资单生成了一份水晶报表.在导出为pdf.doc格式时,它会显示所有员工的报告.
我需要获取单独的员工报告以发送到电子邮件.
谁能帮忙.

Hi,
I have generated a crystal report for employee payslip. while exporting to pdf or .doc format, it shows report for all employees.
I need to get separate employee report to send to an email.
can anyone help.

推荐答案

好吧,我建议在这里使用一种完全不同的方法.由于与工资有关,因此假定工资是高度机密的,因此您不必冒一次产生全部工资然后将其分割发送的风险.

相反,请在此处进行一些小的更改.在报表数据的查询中放置一个简单的WHERE子句.
现在,它就像
Well, I would recomment a totally different approach here. Since, it is related to salary which are assumed to be kept highly confidential, you should not risk on generating all at a time and then splitting it to send.

Instead, just make a small change here. Put a simple WHERE clause in the query of the report data.
For now, it would be something like
SELECT 
  * 
FROM 
  Salary

,而改为

SELECT 
  *
FROM
  Salary
WHERE
  EmployeeID = @EmployeeID



现在,在您的代码中,遍历所有员工并传递相关的employeeID,获取详细信息,创建报告,将其导出并通过电子邮件发送.如果您看到的话,这种方法可以确保一次获取并发送特定于员工的数据.即使存在某种错误或问题,也会由一个人引起.

如果需要,可以将此参数添加到报表中,以便在获取数据时将其传递给查询.



Now, in your code, loop through all the employees and pass on the related employeeID, get the details, create report, export it and send across an email. If you see, this approach has made sure that data specific to an employee is fetched and sent at a time. Even if there is some kind of an error or issue it would be with one person.

If you want you can add this parameter to the report that would pass on the value to query while fetching data.


这篇关于将水晶报表分成单个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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