cancel
Showing results for 
Search instead for 
Did you mean: 

Display data from a single field which has multi line text

Former Member
0 Kudos

Hi All,

Lets assume a field has multi line Text data

Die Firma Sahle Wohnen bietet Ihnen den kompletten Service rund um die Wohnung aus einer Hand an.
Ein vierköpfiges Hauswartteam kümmert sich um die technischen Belange der Wohnanlage.
Die Mitarbeiter der Kundenbetreuung im Kundencenter Frankfurt in der Valentin-Senger-Str.
136b sind Ihr direkter Ansprechpartner für Anliegen rund um die Wohnung.


I want to display data from this field as

1.Show first line only (Crystal report should read the "enter" character and display)
2.Show only last line

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Ravi,

Use this formula to get the 1st line:

stringvar array a;

a := split({database_field},chr(10));

a[1];

In the above formula, the array will have all the values in the string. a[1] will give the 1st line and a[ubound(a)] will give you the last line

If you wish to show the last line is separate formula, just use this:

evaluateafter({@above_formula_name});

stringvar array a;

a[ubound(a)];

Sometimes, new line feeds can either be chr(10) or chr(13), if the above formula doesn't work, just replace chr(10) in the code with chr(13).

Hope this helps!

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Thanks Abhilash...

If I want to display Line 2,3,4 only... (avoid line1) Then how?

abhilash_kumar
Active Contributor
0 Kudos

Hi Ravi,

The array has all the lines starting from position 1. So you can simply loop through the array if you do not know how many lines the array might have.

stringvar array a;

stringvar fin;

numbervar i;

a := split({database_field},chr(10));

for i := 2 to ubound(a) do

(

     fin := fin + a[i] + ",";

);

fin;

Hope this helps!

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Answers (0)