Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Pass clients to subreport: totals Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Pass clients to subreport: totals
     Posted: 07 May 2012 at 11:16pm
Hi all,

I have a report calculating the commission per client. This is done within a certain date range in which the customers paid the bill. In a subreport, I then calculate the costs made for these bills. This is done on a the same date range, but on a different field.

Problem I am having, is that it is possible that there are costs made on a case, but here hasn't been any payments yet. So on the main report the customer doesn't show yet, but in the subreport it does.

I pass the costs with a shared variable. But when I want to pass the total amount, it doesn't match with the figures already shown on the current report.

And when I link the subreport on customer Id or Invoice Id, The total is always 0.

Can anyone help me with this?

Thanks in advance.

Kind regards,

Gerben
IP IP Logged
LynnB
Newbie
Newbie


Joined: 08 May 2012
Online Status: Offline
Posts: 15
Quote LynnB Replybullet Posted: 13 May 2012 at 4:40pm
If I understand your post, the client will always have a cost, but might not have a payment record.

At the moment you are using the main report to calculate the payments, then going to the sub-report to get the costs, turn this around so as the main report holds the costs and the sub-report holds the payments, this way you will also be able to link on your correct indexes

Lynn.


IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 14 May 2012 at 10:14pm
Not exactly. are only a handfull of clients with costs, but loads of clients with payments. It isn't necessary however, that there are payments if a client has any costs. So if I would switch the report around, Wouldn't I only get the clients where there are costs involved?

Edited by Gurbs - 14 May 2012 at 10:15pm
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 15 May 2012 at 3:51am
oke the situation now is like this:
My subreport is in detail section A. I linked the amounts with the following formula's, in the subreport it's

shared numbervar SharedTotalOther;
SharedTotalOther := {@TotalOther};

and in the main report it's

shared numbervar SharedTotalOther;
SharedTotalOther

I linked the subreport on startdate, enddate, and client code. However, for some reason, the total is the same amount as the last client. It isn't picking up the total amount. Is that because my report is linked on Client code?

I'm kind of running out of ideas how to fix this guys... any help would be greatly appreciated.
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 15 May 2012 at 10:15pm
Try resetting your TotalOther to zero in the report header of the subreport.  This should return zero when there are no costs.
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 15 May 2012 at 11:23pm
I tried that, didn't work. I'm still only getting the amount from the last customer.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum