Do not use on any
shared computer
July 25, 2008 12:11am pdt
null
[x]
Attachment Details

Totaling subreport in crystal report

I am building a crystal report that list 401k employee deduction and company match data by pay period.  I then need to have the report total.  I have built the report with two subreport - one that pulls the employee deduction and the other pulls the company match.  I am having a problem with the grand total on the main report.  If I do NOT link the report using the employee id, I get the correct total but incorrect lisitngs .  If I use the employee id link, I get the correct listing but an incorrect total. Here is the way I currently have the report constructed (I'm only supplying info for one subreport since if we can get one to work, I can get the other one to!):

Report Selection on Main Report:
{PRPayCheck.CheckDate} = {?Check Date} and
{PRPayCheck.Status} <> 6

Report Selection on Subreport 1 (401kEE):
({PRTimeCard.FKPREmployee} = {?Pm-PREmployee.SKPREmployee}
and {PRTimeCard.TC1_PayType} = 21
and {PRTimeCard.TC1_FKPayTypeID} = 1
and {PRPayCheck.Status} <> 6)
and {PRPayCheck.CheckDate} = {?Pm-?Check Date}
or
({PRPayCheck.FKPREmployee} = {?Pm-PREmployee.SKPREmployee}
and {PRTimeCard.TC2_PayType} = 21
and {PRTimeCard.TC2_FKPayTypeID} = 1
and {PRTimeCard.Status} = 2
and {PRPayCheck.Status} <> 6)
and {PRPayCheck.CheckDate} = {?Pm-?Check Date}

Formula in SubReport 1 Detail:
if {PRTimeCard.TC1_PayType} = 21 and {PRTimeCard.TC1_FKPayTypeID} = 1 then {PRTimeCard.TC1_ActualWages}
else
if {PRTimeCard.TC2_PayType} = 21 and {PRTimeCard.TC2_FKPayTypeID} = 1 and {PRTimeCard.Status} = 2 then{PRTimeCard.TC2_ActualWages};

In Report footer on subreport:
WhilePrintingRecords;
Shared CurrencyVar SubTotal := Sum({@401ke})   (I only get the last record data using this)

In Report footer on main report:
WhilePrintingRecords;
Shared CurrencyVar Subtotal;
Subtotal  



Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Database
Question Asked By: stephaniem712
Solution Provided By: frodoman
Participating Experts: 1
Solution Grade: A
Views: 38
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by frodoman

Rank: Master

Expert Comment by frodoman:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by stephaniem712
Author Comment by stephaniem712:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by frodoman

Rank: Master

Expert Comment by frodoman:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by stephaniem712
Author Comment by stephaniem712:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by frodoman

Rank: Master

Expert Comment by frodoman:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by stephaniem712
Author Comment by stephaniem712:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by frodoman

Rank: Master

Expert Comment by frodoman:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by stephaniem712
Author Comment by stephaniem712:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by frodoman

Rank: Master

Accepted Solution by frodoman:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by stephaniem712
Author Comment by stephaniem712:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628