| Author |
Message |
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
|
|
LynnB
Newbie
Joined: 08 May 2012
Online Status: Offline
Posts: 15
|

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 Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
yggdrasil
Senior Member
Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
|

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 Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
|
|