on 08-23-2012 12:51 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.