Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange carriage return in @text(rtf)?

Status
Not open for further replies.

HighLife

Programmer
Jun 17, 2003
12
AU
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.
 
If you use @newline in the view, it should work.
As for your carriage return problem, maybe you could add a @trim to the @text and see what happens.

Pascal.
 
Yeah I have tried @Trim but it doesnt appear to make a difference? I did manage to solve it though by using


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?
 
Do the view properties allow for more than one line per document ?

Pascal.
 
I have rows set to a height of 4 lines and the "shrink rows to content" checked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top