Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Using a subreport total to do a calculation in the Post Reply Post New Topic
Author Message
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Topic: Using a subreport total to do a calculation in the
    Posted: 05 Nov 2013 at 7:28am
I have a sub-report linked to my main report to pull an account balance.  I then need to use that sub-report account balance and subtract that from a figure in the main report.  How do I do that?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Dec 2013 at 5:01am
I would assume you figured it out, but the answer would be shared variables, in the main before the call to the subreport you would have the reset:
shared numbervar x:=0;
"" //hides the reset

in the subreport, probably the report footer
shared numbervar x;
x:= however you calculated the balance
"" //again to hide the balance

in the main report, after the subreport
shared numbervar x;
//use x however needed in the main report

sorry this is late, I don't monitor this forum very often.

HTH
IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 10 Dec 2013 at 5:15am
I will see if I can figure this out as the syntax you have used is not in Crysal Reporting format.  Thank you and I will see what I can do.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Dec 2013 at 5:21am
Actually, except for how you actually use the variable, it is CR syntax...native syntax, not Visual Basic.

All that I am showing is how to declare, set, and access a shared variable...since I have no idea of what the database/datatable structure is or how you need/plan to use the value.

HTH
IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 10 Dec 2013 at 5:31am

I undersand.  Thank you for all of your assistance.  I will see how I can use your information to run the reports.

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.029 seconds.