Solved

crystal reports programming problem

Posted on 2012-04-02
8
279 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Speed Up Crystal Report 5 66
Multiple Parameters in Crystal 11 84
Exclude some records from totals 10 63
Unable to total correct amount due to line duplication 5 35
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
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…

679 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