Click here to Skip to main content
15,920,688 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 25-Feb-11 18:18pm
v2
Comments
Sergey Alexandrovich Kryukov 26-Feb-11 1:47am    
For a record, "splitting" contradicts to "into a single".
I advice to change the title.
--SA
Sergey Alexandrovich Kryukov 26-Feb-11 1:56am    
You should not duplicate questions. If you don't like the answer, use "Improve Question" and/or "Add comment" and express your concerns.
--SA

1 solution

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
SQL
SELECT 
  * 
FROM 
  Salary
, instead make it as
SQL
SELECT 
  *
FROM
  Salary
WHERE
  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.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Feb-11 1:49am    
You fix the wrong idea, my 5.
Actually, very typical design mistake and lack of understanding of separation of concerns.
--SA
Sandeep Mewara 26-Feb-11 1:53am    
Thanks SA.

Yet, the OP ignored my answer and reposted almost similar question.
Had replied back their too: http://www.codeproject.com/Questions/162355/splitting-the-crystal-report-into-a-single-page.aspx
Sergey Alexandrovich Kryukov 26-Feb-11 21:56pm    
And that was a good answer, too, I voted.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900