Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report Design Post Reply Post New Topic
Author Message
GeorgeK
Newbie
Newbie


Joined: 31 Oct 2010
Online Status: Offline
Posts: 8
Quote GeorgeK Replybullet Topic: Report Design
     Posted: 31 Oct 2010 at 8:38pm
Hi All,
I need assistance on some project am working on. I am designing a Loan Statement which has basic member info such as Name, loan type, loan amount, interest etc on the REPORT HEADER
 
I need to design the DETAIL SECTION of the report in such a manner that depending on the number of repayment period(i.e 5 months) the Loan principal and interest will loop 5 times as the amounts keep reducing until its nil.
 
Start Date          Principal   interest
31-Jan-2010      50000         500
28-Feb-2010      40198         401
31-Mar-2010      30298         302
30-Apr-2010      20298         202
31-May-2010     10199         102
30-June-2010    0                  0
 
Your assistance will be much appreciate.


Edited by GeorgeK - 31 Oct 2010 at 8:42pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Nov 2010 at 5:48am
you will need to 'create' rows to match.
 
if there is only 1 row in the select statement for what you are looking for, there will only be 1 row in the report.  CR won't loop and continually look at the same row of data...
 
if you need 5 rows until the value is 0, you will need rows of data for CR to work with.
 
Sorry for not being able to help more.
IP IP Logged
GeorgeK
Newbie
Newbie


Joined: 31 Oct 2010
Online Status: Offline
Posts: 8
Quote GeorgeK Replybullet Posted: 01 Nov 2010 at 11:57pm
Thanks lockwelle for your response.
 
Yes and you are right the select statement only results in one row. So basically it means am stuck unless I create  a table in the database to create more rows.
 
If there is anyone who has a different opinion kindly assist. I had this notion that CR was a very powerful reporting tool.
 
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Nov 2010 at 6:58am
In its defense, none of the other major reporting systems out there would behave any better.  SQL Server Reporting Services and DevXpress.XtraReports, both of which I have personal experience with, behave the same way.
 
If there are multiple values on 1 line, or some value that can be used for the calculation, you can probably 'trick' the reporting tools into displaying more than 1 value, but it would all be on 'one' line...if there was other information to display, it would look like:
xxxxxx   xxxxx xxxxx  xxxxxx xxxxxx
xxxx
xxxxxx
xxxxxx
xxxxxx
 
yyyyyy  yyyyy yyyyy yyyyyyy yyyyyy
yyyy
yyyy
 
 
which looks kind of silly.
 
HTH
IP IP Logged
GeorgeK
Newbie
Newbie


Joined: 31 Oct 2010
Online Status: Offline
Posts: 8
Quote GeorgeK Replybullet Posted: 02 Nov 2010 at 6:48pm

Once again thanks very much Lockwelle for your response.

Would you kindly tell me how I can trick the report to show multiple values on one line. Atleast it will be a step closer to achieving what I want.
I am in a tight corner so am open to any suggestions no matter how silly they seem.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Nov 2010 at 3:25am

say that you have a field that is how much it decreases:
local numbervar iDec := {table.field1};
local numbervar iOrig := {table.field2};
local datetimevar dPaid := {table.field3};
local stringvar crlf := CHRW(13) + CHRW(10);
shared stringvar sPrincipal := iOrig + crlf ;
shared stringvar sInterest := iDec + crlf;
shared stringvar sDate := totext(dPaid, "dd-MMM-yyyy);
local numbervar iCount := 0;

WHILE sPrincipal > 0 DO
(
 iCount := iCount + 1;
 iOrig := iOrig - iDec;
 sPrincipal := sPrincipal + iOrig + crlf;
 sInterest := sInterest + iDec + crlf;
 sDate := sDate + totext(DATEADD("m", -1 * iCount, dPaid), "dd-MMM-yyyy) + crlf;
);

""   //hides all the calculations

OK, that is the formula that creates 3 strings...say it is in a band...doesn't matter which one, let's say a group footer for example.
I would place the formula in the group footer, then I would add a section to the group footer, so that the formula is in a, and what we want to display is in b.  Suppress group footer a.  Write 3 formulas to access the shared variables, like:
shared stringvar sDate
 
place the 3 formulas on the report and set the textbox to 'Can Grow'...it should display as the example.
 
Obviously, you will need to tweak the example to fit the actual interest calculation.  If it is multiple fields, you can use the iCount as a flag to determine which field to use when.
 
The idea is give you a path to a solution.
 
HTH
IP IP Logged
GeorgeK
Newbie
Newbie


Joined: 31 Oct 2010
Online Status: Offline
Posts: 8
Quote GeorgeK Replybullet Posted: 14 Nov 2010 at 8:02pm
Lockwelle you are a genius, it worked like a charm. Thanks so so much.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum