Kore Tech Tip
How to Format Edit Text Fields for Better Reports
Tip
#1010

How to Format Edit-Text Type Data by Removing the Line Feeds

Have you ever had difficulty listing data that has been entered in Edit-Text fields? The problem is that the Edit-Text data is stored with a char(251) in the attribute to separate the lines of text on the screen. This tech tip describes how to remove those characters that are causing the line feeds and allow the data to be formatted by the dictionary item when listing this data on reports.

Note that the data was entered as 3 lines in an Edit-Text field as follows:
Here is some text that we can review for

our test from the WO-BOO record

Can you see me now!!!
Here’s the data with no formatting using a dictionary item with maximum width set at 30 characters:
WO-BOO.... Notes....................

1032       Here is some text that we

           can review for

            our test from the WO-BOO

           record

            Can you see me now!!!
Here is the same data using our dictionary item described below, with the width set at 30 characters:
WO-BOO.... NOTES.........................

1032       Here is some text that we can

           review for our test from the

           WO-BOO record Can you see me

           now!!!
This dictionary does a great job of that. It took me a while to discover that when the data is listed, the char(251) had been changed to a char(250). Note, we’re reporting on the WO-BOO file and grabbing the notes from the WO file.
------------------- DICTIONARY EDITOR -------------------

 1. File Name......: WO-BOO

 2. Item Name......: WO_NOTES

 3. Copy From......:

 4. Code Type......: I    (Read from CUSTOM)

 5. Attribute/Vcode: TRIM(CONVERT(CHAR(250)," ",TRANS("WO",F0,28,"X")))

 6. Conversion.....:

....+....1....+....2....+....3....+....4....+....5

 7. Column Heading.: NOTES

 8. Display Format.: 30T

 9. Structure......: S              10. Association...:
Try it, you'll like it!
 
 
 
Our technical tips are provided to help you find new or easier ways to solve some of your technical challenges or to show you a new technique. We hope you find them useful. Please contact us if you would like to share one of your Tech Tips or need help solving a technical challenge. We would be happy to help you.