Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

crystal reports programming problem

Posted on 2012-04-02
8
Medium Priority
?
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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