Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Passing total from sub-report back to main report Post Reply Post New Topic
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet 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 IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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 IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet 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 IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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 IP Logged
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.047 seconds.