Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Capture data an display in report footer Post Reply Post New Topic
Author Message
TAH2
Newbie
Newbie
Avatar

Joined: 16 Mar 2010
Online Status: Offline
Posts: 23
Quote TAH2 Replybullet Topic: Capture data an display in report footer
     Posted: 19 Nov 2010 at 10:25am
Is it possible to capture data about a specific record and display that information in the report footer. 
 
 
Contract          Type           Amount
1899                Gas            2,000
9087                 IRB            5,000
8003                 IRB            8,000
 
Contract 9087 is non-binding.....the balance is 5,000
 
I want to capture the amount for Contract 9087 and display it in the footer of a report.  How can I accomplish this.  This seems so simple but when I tried to load a variable it didn't work.  I am not sure what I am doing wrong.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Nov 2010 at 8:35am
was the variable shared or global?  local variables won't carry over.
 
Also, did you assign another value to the variable which set it to NULL or an empty string?  Something like: if {table.field} = something then x else ""
 
would have this type of effect.  Typically if I want a variable to display in the footer, I will have in the header variable := "", then in the detail, I will only assign or update the variable to a value, never to "".
 
HTH
 
IP IP Logged
TAH2
Newbie
Newbie
Avatar

Joined: 16 Mar 2010
Online Status: Offline
Posts: 23
Quote TAH2 Replybullet Posted: 23 Nov 2010 at 9:08am

The variable was shared and the following was added to the header

Shared NumberVar NBLocBal := 0;

I only want to capture the amount when a certain condition is met.

if ContNo = 9087 then NBLocBal := Amount (5,000).  I put a similar statment in the detail. 

If I use the if then statment there has to be an else.  If the Amount is set to 0 when ContNo <> 9087 then NBLocBal will be 0 in the footer.
 
How do I set the variable only when my condition is met and display the data in the footer.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Nov 2010 at 10:34am
there doesn't need to be an else.
 
Else just gives the option to perform something.
 
it can be just:
if ContNo = 9087 then NBLocBal := Amount (5,000);
 
HTH
IP IP Logged
TAH2
Newbie
Newbie
Avatar

Joined: 16 Mar 2010
Online Status: Offline
Posts: 23
Quote TAH2 Replybullet Posted: 23 Nov 2010 at 10:47am
Thanks.  That worked.  I thought that you had to use an else with the if then statement based on documentation that I read.  Thanks again.
IP IP Logged
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