Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Clearing Subreport Totals Post Reply Post New Topic
Author Message
DianeColvin
Newbie
Newbie
Avatar

Joined: 30 Dec 2013
Location: United States
Online Status: Offline
Posts: 4
Quote DianeColvin Replybullet Topic: Clearing Subreport Totals
    Posted: 04 Feb 2014 at 11:53am
I am fairly new to Crystal Reports.  I have a subreport with a link (whse id) from the main report.  In the subreport I have total fields that I pass back out to the main report.  My problem is, if there is no link (no information for the given whse id in the table in my subreport), it retains the value from the last total fields printed (from previous whse id).  How do I clear the total fields after I print them so the values don't show up for the next whse which should have 0.

Thank you,
IP IP Logged
DianeColvin
Newbie
Newbie
Avatar

Joined: 30 Dec 2013
Location: United States
Online Status: Offline
Posts: 4
Quote DianeColvin Replybullet Posted: 04 Feb 2014 at 11:54am
Forgot to mention:  Subreport runs at Detail time, Totals print at Group Footer #2.

Edited by DianeColvin - 04 Feb 2014 at 11:54am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Feb 2014 at 6:29am
I would suggest putting a formula in the GH#2 that initializes the shared variable to zero.
IP IP Logged
DianeColvin
Newbie
Newbie
Avatar

Joined: 30 Dec 2013
Location: United States
Online Status: Offline
Posts: 4
Quote DianeColvin Replybullet Posted: 05 Feb 2014 at 7:18am
Yes.  But if I have 5 fields call them a, b, c, d, e, what would the formula look like?  I want all to be set to 0 at GH2


IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Feb 2014 at 11:57am
if you have 5 shared variables that need to be cleared.  Then the formula would looks something like this (assuming the shared variables are numbers)
shared numbervar a :=0;
shared numbervar b :=0;
shared numbervar c :=0;
shared numbervar d :=0;
shared numbervar e :=0;
IP IP Logged
DianeColvin
Newbie
Newbie
Avatar

Joined: 30 Dec 2013
Location: United States
Online Status: Offline
Posts: 4
Quote DianeColvin Replybullet Posted: 05 Feb 2014 at 2:15pm
Thank you Smile
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.