Solved

crystal reports programming problem

Posted on 2012-04-02
8
277 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
ID: 37798217
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
ID: 37798241
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
ID: 37798362
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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:telliot79
ID: 37798454
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
 

Author Comment

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

Author Closing Comment

by:telliot79
ID: 37798483
mahahaaaagicaaaaal
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37798821
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
ID: 37799215
Very true, but both will work

-- SK Bow 2 D
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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