Solved

crystal reports programming problem

Posted on 2012-04-02
8
276 Views
Last Modified: 2012-04-02
experts,

I'm trying to create a running balance of an account on a crystal report. I have the ending balance, and all of the transactions in a given period, but I need a little help in how to calculate the historic balance, given the current balance and adding or subtracting the historic transactions.

For example, if my ending balance was 100 dollars, and i had 10 deposits of 10 dollars over a given period, the data would look like this:

Date                  Balance      Amount      Tran type
2/28/2003      100      10      Credit
2/27/2003      90      10      Credit
2/26/2003      80      10      Credit
2/25/2003      70      10      Credit
2/24/2003      60      10      Credit
2/23/2003      50      10      Credit
2/22/2003      40      10      Credit
2/21/2003      30      10      Credit
2/20/2003      20      10      Credit
2/19/2003      10      10      Credit
2/18/2003      0      0      open acct

I've got the 100 dollar amount, and need to subtract it to get to 90 dollars and so on. I'm sure this is possible, but just don't know how to get to it.

thanks in advance for the help.
0
Comment
Question by:telliot79
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:Ess Kay
Comment Utility
i would use a shared variable in crystal

add the variable to the details to be

 variable = variable - deposit




http://www.ehow.com/how_5287432_use-shared-variable-crystal-report.html
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 500 total points
Comment Utility
you have to create 3 formulas.

F1.  declare shared variable  (use declaration from link above -   place in start of report)
F2.   variable = customer.starting_balance (place into group header of customer. set to balance)
F3.   variable = variable - deposits  (place in details)
0
 

Author Comment

by:telliot79
Comment Utility
can you provide a little more detail please? i'm not sure what i'm setting the shared variable to.

thanks for the prompt responses.
0
 

Author Comment

by:telliot79
Comment Utility
here's what I have:
F1: Shared NumberVar variable; - in page header
F2:  Shared NumberVar variable;
       variable:={Command.cur_bal} - in group header
F3: Shared NumberVar variable;
      variable-{Command.AMT}; - in detail

i'm getting some strange results that don't make sense. can you see what i'm doing wrong?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:telliot79
Comment Utility
figured it out, had F3 wrong. got it now. thanks for the help and quick responses.
0
 

Author Closing Comment

by:telliot79
Comment Utility
mahahaaaagicaaaaal
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
No need for shared variables.  Thise are intended for sharing with a subreport.  Use Global variables.

mlmcc
0
 
LVL 15

Expert Comment

by:Ess Kay
Comment Utility
Very true, but both will work

-- SK Bow 2 D
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now