Solved

Creating Amortization Schedule Report

Posted on 2004-03-26
9
876 Views
Last Modified: 2006-11-17
I am trying to create an amortization schedule report using Crystal Reports 8.0, however, I cant seem to figure out how to get it to loop until the balance is 0. Any idea on how to do this?

Thanks
0
Comment
Question by:jquintero33
  • 3
  • 2
  • 2
9 Comments
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Here's the basic code for a loop:

numberVar RemainingBalance := 10000;
do
(
    RemainingBalance := RemainingBalance - 150;    
)
while RemainingBalance > 0;

0
 

Author Comment

by:jquintero33
Comment Utility
So how do I get it to print a record for each payment?
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
You can't print a record for each payment but you can print a single record showing all payments - obviously you'll need to add the code for calculating the payment amount and interest, etc.  You'll probably want to add logic to make sure the last payment isn't more than the remaining balance, etc.  

This Crystal formula contains all of the structure that you need - you'll just have to add the mathmatic formula you want to use.


numberVar RemainingBalance := 10000;
numberVar PayAmount;
numberVar IntAmount;
stringVar LineBreak := chr(10) + chr(13);
stringVar Results := '';  <-- That's two single quotes, not a double quote
do
(
     PayAmount := 150;  
     Results := Results + ' Payment Amount: ' + ToText(PayAmount,2);  
     RemainingBalance := RemainingBalance - PayAmount;
     IntAmount := 15;      
     RemainingBalance := RemainingBalance + IntAmount;
     Results := Results + ' Interest: ' + ToText(IntAmount,2) + ' New Balance: ' + ToText(RemainingBalance,2);
     Results := Results + LineBreak;
)
while RemainingBalance > 0;
Results;

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Expert Comment

by:Jstncase
Comment Utility

If you want to print a record for each payment then use a For loop instead of a Do loop. With the FOR loop you can specify how many payments or how many years you are doing the amortization for. ie:

numberVar Payment :=1400;
numberVar Balance :=1400;

Dim X
For X = 1 to 360                              // 1 payment for each month for 30 years
  Balance :=Balance - Payment;        // payment calc
  Balance                                        // Shows balance after payment applied for each month
Next X


Sorry for being so rough/vague, its early for me and doing this from memory. Later in the day I can write through this better or in more detailed. Hoping this will help give you an idea.

And my reason for saying do a Do loop is because (i think) when it prints out it would display as 1 long formula, instead of doing it after every payment. But you should be able to put just the variable for the new amount after the payment calculation to print a balance after every payment.
0
 
LVL 10

Expert Comment

by:Jstncase
Comment Utility
Well ther ya have it. I like frodoman's answer much better. mine was just a quickie and i havent had any coffee yet.
0
 

Author Comment

by:jquintero33
Comment Utility
I created a formula field and copied the above formula into it and put it in the Details section of the report. When I run it, it tells me "A string can be at most 254 characters long." Any way around this?

Thanks
0
 
LVL 42

Accepted Solution

by:
frodoman earned 30 total points
Comment Utility
The only way around that is to upgrade to a more recent version of Crystal.  CR9 for example supports strings up to 65534 characters.

You could also look into using an array of strings (stringVar array Result) but this would probably only work effectively if you used on array element for each payment which means you would have to have a fixed number of payments.


You know, as much as I like using Crystal it isn't the answer for everthing.  IMHO you should probably be doing this in Excel instead as it has built in functions to handle this and can be done much more efficiently.  Just a thought because it sounds like you've got an older version of CR and I don't think you're going to be able to solve this problem here.

Good luck though,

frodoman
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

18 Experts available now in Live!

Get 1:1 Help Now