Print Page | Close Window

Suppress Blank Line in Text Box

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16701
Printed Date: 02 May 2025 at 2:16pm


Topic: Suppress Blank Line in Text Box
Posted By: chiefwiggy
Subject: Suppress Blank Line in Text Box
Date Posted: 07 Jun 2012 at 8:00am
I will apologize for the long post ahead of time but I want to give a fairly clear picture of what I am trying to accomplish in this initial post. I am also new to programming so my methods may seem a bit cumbersome. Any help is much appreciated.

I need to create up to 10 80-character lines per record (call them M records) in a text file. Each M record contains multiple fields and spaces that I am pulling from a database and has a set number of characters per field.

The M records are related to Mortgage Loan information. Records M05 through M08 are only needed if there are co-borrowers on specific loan (M05 = Co-Borrower #1, M06 = Co-borrower #2, etc.). If not, I need to suppress the line.

I have defined a formula for each piece of the specific M Record (including any necessary totext functions and spacing). For example, M05_02 is to have a length of 25 characters and contain the spouses first name. It contains the following formula: left({coborrow.spouse_fn}+Space(25),25)

The M05Record formula is a formula that is on the report and is embedded in a text box below the M04Record file. The formula in the M05Record is:
if {@M05_04}=space(9) then

   Space(80) //I have also tried '' rather than Space(80)

else
      {@M05_01}+{@M05_02}+{@M05_03}+{@M05_04}+{@M05_05}

M05_04 is the spouse SSN. If it is not present the formula returns Space(9), otherwise it returns the nine character ssn.

PROBLEM: In the text box, I have checked the "Suppress Embedded Field Blank Lines" but the report still has a blank line between the M05 and M09 record(I have not included M06-M08 in the text box yet). I don't want the blank lines showing up in the report if the data is not present.

I have tried 1 text box, 1 text box per M record, I have tried multiple detail sections with and without individual text boxes. Any suggestions?

Thanks,

CW



Replies:
Posted By: chiefwiggy
Date Posted: 07 Jun 2012 at 8:12am
One quick note: It does suppress the M5 line so that M09 is on the next line after M04 but it adds and additional line after after M10 (the last of the MRecords per loan record)where M05 does not contain any data.


Posted By: comatt1
Date Posted: 31 Aug 2012 at 10:12am
SELECT     REGEXP_REPLACE ( tester
                 , '(^|' || CHR (10) || ')' || CHR (10) || '+'
                 , '\1'
                 )
FROM     test_tab
;



Print Page | Close Window