Crystal Reports 2008

I am trying to create a report using Crystal Reports 2008.
For my end result, I want the loans grouped by:
1.Lien Position
a.1st
b.2nd
then by:
2.@Adjustable
a.Fixed Rate
b.Balloon/Hybrid
c.Adjustable Rate (<= 1yr)
d.Adjustable Rate(> 1yr)
Then by:
3.@Type
a.> 15yrs
b.<= 15yrs
c.> 5yrs
d.<= 5yrs
Part of the report should look like this:
                                                    # of loans             Amount
First Mortgages
      Fixed Rate
                               >15yrs                  500            50,000,000
                               15 yrs or less      1,000        60,000,000
      Balloon/Hybrid
                                 >5yrs                  10               500,000
                                  5 yrs or less     50              1,000,000
      Adjustable Rate
                              1yr or less            20              2,000,000
                             >1 yr                       100            10,000,000
Other Real Estate (2nd liens)
      Closed End Fixed                      400            10,000,000
TOTAL                                                 2,080      133,500,000

Here is the code that I have for @Adjustable:
if {stored procedure;1.LienPosition}="1"  then
    if isnull({stored procedure;1.BalloonPayDt}) then
        if  {stored procedure;1.LoanPayType}="F"  then
           "Fixed Rate"
        Else IF {@DaystoRateChange}=0  then
           "Other"
        Else If {@DaystoRateChange}<=12 then
           "Adjustable Rate 1 yr or less"
        Else
           "Adjustable Rate > 1 yr"
    Else
        "Balloon/Hybrid"
Else If isnull({stored procedure;1.FirstRateChgDt}) then
     "Closed-end Fixed Rate"
Else
      "";

@YrsToMaturity code:
iif({@Balloon}= "Other",{stored procedure;1.LoanTerm}/12,
datediff("d",{stored procedure;1.DueDtFirstPay},{storedprocedure;1.BalloonPayDt})/365)

@Balloon code:
iif(isdate(cstr({stored procedure;1.BalloonPayDt})),"Balloon","Other")

@Type code:
if {@Adjustable}= "Fixed Rate" then
   if {@YrsToMaturity}> 15 then
        "> 15 Years"
   Else "15 Years or less"
Else If {@Adjustable}="Balloon/Hybrid" then
        if {stored procedure;1.LienPosition}="participation" or {@YrsToMaturity}>5 then
            "> 5 Years"
    Else "5 Years or less"
Else "";
I am at the @Type formula and the results I am getting are only results for the Balloon/Hybrid section and showing if the loans are > 5 years or if they are 5 years or less. All the other categories have them falling under “Other”. I am inserting groups for Lien position, Adjustable and Type and specify an order within the groups. I am not too familiar with Crystal Reports and any help would be greatly appreciated.  
moni81011Asked:
Who is Participating?
 
mlmccCommented:
Are there reports where the BalloonPayDt is null?

If so you need to test for that in the @Ballon code.

mlmcc
0
 
mlmccCommented:
Do you get any Fixed Rate records for @Adjustable?

mlmcc
0
 
musalmanERP ConsultantCommented:
can you attach the report
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
moni81011Author Commented:
I did get fixed rate results with the @adjustable, thank you.  Everything seems to be displaying correctly besides separating the fixed rate section between "> 15 Years" and  "15 Years or less".  They are all still combined into one.  So I was thinking my IF THEN and ELSE may be in the wrong place or it is just wrong somehow.

if {@Adjustable}= "Fixed Rate" then
   if {@YrsToMaturity}> 15 then
        "> 15 Years"
   Else "15 Years or less"
Else If {@Adjustable}="Balloon/Hybrid" then
        if {CallReportRealEstateNoBusiness_sp;1.LienPosition}="participation" or {@YrsToMaturity}>5 then
            "> 5 Years"
    Else "5 Years or less"
Else "";

If you need a screen shot of the report and what it looks like, let me know.
Thank you.
0
 
mlmccCommented:
Are there mortgage for less than 15 years?

mlmcc
0
 
moni81011Author Commented:
Yes sir.
0
 
moni81011Author Commented:
I got it. For some reason it didn't like the formula in the @balloon. I thought because it said if there is a date put "balloon", else "other". Well I changed it to say if it is null "other" else "balloon" and it worked. Thank you for telling me to take a look at that formula!
0
 
moni81011Author Commented:
Thank you for all your help mlmcc!!!
0
 
James0628Commented:
The problem is that if CR hits a null field in a formula, it just stops evaluating the formula at that point and the formula produces no value.  To avoid that, you can use the IsNull function to test the field _first_, before you do anything else with that field in that formula.

 Another option is to go to File > "Report Options" and set the "Convert Database NULL Values to Default" option, which will replace nulls in pretty much every formula in the report, except the record selection formula.  More recent versions of CR also have an option in the formula editor for how that specific formula will handle nulls.

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.