| Author |
Message |
Kitty1
Senior Member
Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
|

Topic: Passing total from sub-report back to main report Posted: 04 Aug 2016 at 6:06am |
|
Hi, I am doing a report which seems quite simple, and I know i have used sharing between reports and sub reports, but it has been a while.
I am trying to write a report that will print accounts receivable statements. I do not want any zero balance invoices to show.
so if in the detail, i have something like this:
Invoice #
244567 invoice $5.00
244567 payment $5.00
which leaves the balance of this invoice at zero.
I am grouping by Invoice number. I cannot use the total to suppress the section, because the total is not yet known when it is printing the detail.
so i thought very simple, i will write a sub-report to get the total, then pass it back to the main report to use to suppress zero invoice sections.
I cannot get it to work. I have tried various combinations. Does anyone have any idea how i could do this ? simple explanation if possible, i am not real advanced in Crystal.
Thanks!
|
IP Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

Posted: 02 Sep 2016 at 1:00pm |
|
you would want to use a shared variable, that is a value that can cross from the main report to a subreport.
I would also try a layout like this:
gh1
detail
gf1
I would put the subreport in gh1, then use the results to suppress the detail section.
hopefully this makes sense.
|
IP Logged |
|
Kitty1
Senior Member
Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
|

Posted: 06 Sep 2016 at 5:01am |
|
Hi Lockwelle and thanks for your reply. That is what i tried, and it's not working for some reason :( i also tried suppressing the group header if that field is zero, and it suppresses everything and just gives me the report total... any idea why this would not be working?
|
IP Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|

Posted: 06 Sep 2016 at 10:40am |
|
Are you suppressing the section where the sub-report is? If so, then the sub report will not execute. If you want to 'hide' the sub report then you have to do other thing. Suppress all sections of the sub report. In the properties of the sub report, click on Suppress Blank Subreport (Format Subreport, Subreport tab), then in the section expert (where the subreport is), click on Suppress Blank Section.
|
IP Logged |
|
|
|