Strange carriage return in @text(rtf)?
Strange carriage return in @text(rtf)?
(OP)
I have multiple RTF fields on a form which I combine in a single hidden computed plain text field for displaying in a view (as RTF fields cant be displayed in a view). The plain text field computed value code is something like this:
a := @Text(Item1Qty) + " " + "x" + " " + @Text(QuoteItem1);
b := @If(Item2Qty="" ; "" ; ";" + @NewLine + @Text(Item2Qty) + " " + "x" + " " + @Text(QuoteItem2));
c := @If(Item3Qty="" ; "" ; ";" + @NewLine + @Text(Item3Qty) + " " + "x" + " " + @Text(QuoteItem3));
d := @If(Item4Qty="" ; "" ; ";" + @NewLine + @Text(Item4Qty) + " " + "x" + " " + @Text(QuoteItem4));
e := @If(Item5Qty="" ; "" ; ";" + @NewLine + @Text(Item5Qty) + " " + "x" + " " + @Text(QuoteItem5));
f := @If(Item6Qty="" ; "" ; ";" + @NewLine + @Text(Item6Qty) + " " + "x" + " " + @Text(QuoteItem6));
a + b+ c + d + e + f
This works but in the output there appears to be a carriage return at the start of the converted RTF field?
For example the result I get is:
2 x
This particular item;
3 x
Another particular item;
1 x
Yet another item
Where as it should be:
2 x This particular item;
3 x Another particular item;
..etc
I cant work out why there is a carriage return displaying before the "QuoteItem#" fields?
On a related note - is there a way to display carriage returns in a view? When the above text field is displayed in a view there are no carriage returns at all - its just one single line of text.
a := @Text(Item1Qty) + " " + "x" + " " + @Text(QuoteItem1);
b := @If(Item2Qty="" ; "" ; ";" + @NewLine + @Text(Item2Qty) + " " + "x" + " " + @Text(QuoteItem2));
c := @If(Item3Qty="" ; "" ; ";" + @NewLine + @Text(Item3Qty) + " " + "x" + " " + @Text(QuoteItem3));
d := @If(Item4Qty="" ; "" ; ";" + @NewLine + @Text(Item4Qty) + " " + "x" + " " + @Text(QuoteItem4));
e := @If(Item5Qty="" ; "" ; ";" + @NewLine + @Text(Item5Qty) + " " + "x" + " " + @Text(QuoteItem5));
f := @If(Item6Qty="" ; "" ; ";" + @NewLine + @Text(Item6Qty) + " " + "x" + " " + @Text(QuoteItem6));
a + b+ c + d + e + f
This works but in the output there appears to be a carriage return at the start of the converted RTF field?
For example the result I get is:
2 x
This particular item;
3 x
Another particular item;
1 x
Yet another item
Where as it should be:
2 x This particular item;
3 x Another particular item;
..etc
I cant work out why there is a carriage return displaying before the "QuoteItem#" fields?
On a related note - is there a way to display carriage returns in a view? When the above text field is displayed in a view there are no carriage returns at all - its just one single line of text.
RE: Strange carriage return in @text(rtf)?
As for your carriage return problem, maybe you could add a @trim to the @text and see what happens.
Pascal.
RE: Strange carriage return in @text(rtf)?
a := @Text(Item1Qty) + " " + "x" + " " + @Text(QuoteItem1);
@ReplaceSubString(a;@NewLine;"")
I still have no idea where the carriage return came from though?
I still cannot get @NewLine to work in a view column - is it possible to have a carriage return in a view column?
RE: Strange carriage return in @text(rtf)?
Pascal.
RE: Strange carriage return in @text(rtf)?