Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

crystal reports programming problem

Posted on 2012-04-02
8
Medium Priority
?
283 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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

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 101

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: 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.

Question has a verified solution.

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

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. …
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

886 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