Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Pass date from sub to main report Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2012 at 3:34am
in the sub report for the shared variable formula that gets your amount set it to use default values for nulls. i think that will address the 0 issue, other wise you can reset the value in the main report by placing another shared variable in the another group header (above the sub report) to set the shared variable to 0.
to gtrid of the space you can
suppress every section inside of the sub report
in the main reoport right click on the sub report ans select format subreport
select subreport tab
make 'suppress blank subreport' as true (checked)
then in the main report section expert set the section the subreport is on (GH) to 'suppress blank section' as true


Edited by DBlank - 02 May 2012 at 3:36am
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 02 May 2012 at 3:46am
Originally posted by DBlank

in the sub report for the shared variable formula that gets your amount set it to use default values for nulls. i think that will address the 0 issue, other wise you can reset the value in the main report by placing another shared variable in the another group header (above the sub report) to set the shared variable to 0.


What do you mean by this? How do I set the default value to 0?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2012 at 4:02am

when editing a formula there is a pick list option in the expression editor that has 2 choices, exceptions for nulls/ default values for nulls

IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 02 May 2012 at 5:06am
I tried this option, it didn't work. What about your other option, the one with an extra shared variable? How do I do that?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2012 at 5:54am
create another formula field in the main report that initializes the shared variable and sets it value to 0.
it needs to be placed in a GH that is above the sub report (it can be suppressed)
 
shared numbervar OtherCosts;
OtherCosts := 0;
 
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 03 May 2012 at 3:30am
Perfect, this works! Only problem I'm having now is with the grand total of these costs. It is now only picking up the commission from the last customer.
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 03 May 2012 at 5:30am
oke I coppied the subreport, and I run it in the Report header as well as in the Group header. Now I am getting the total. But I have another, out-of-the-box issue now.

In the main report, I calculate the collections per client. This is done on payment date. In the subreport, the commission is calculated based on start date. The problem now is, that there are cases that have started in the date range, but doesn't have payments yet. So in the main report they don't show. But when I just use the total out of the subreport, the numbers don't add up with what's in the main report. Anyone has any ideas how I can work around this?
Running totals in the main report doesn't work, he's saying that this field can not be summarized......
IP IP Logged
<< Prev Page  of 2
Post Reply Post New Topic
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



This page was generated in 0.012 seconds.