How to Change Line in 1 textbox (Report)

hai…could navision change line?

i want to add purchase comment line in purchase header (Purchase Order Report)

I want to add code like VbCrLf (In visual basic or Visual basic .NET)

PurchaseCommentLine.SETRANGE(“Document Type”,PurchaseCommentLine.“Document Type”::Order);
PurchaseCommentLine.SETRANGE(“No.”,“No.”);
IF PurchaseCommentLine.FINDSET THEN
REPEAT
IF PurchaseCommentLine.Comment <> ‘’ THEN
CommentText := CommentText + ’ ’ + PurchaseCommentLine.Comment;
UNTIL PurchaseCommentLine.NEXT = 0;

→ this ’ ’ code , how to be change line?

like if we use “ENTER” button in our PC

Why don’t you just add PurchaseCommentLine as a DataItem related to the Purchase Header? Then add a section to print them.

hehehhe… i’d done that, it’s so simple without customized code,right?

but you know… users…

they want it to be equal as purchase header

so i must add code like this

but i don’t knowhow to change line

Has babrown said. Each dataitem will be print in a new line. Then you can print a newline for each comment line.

I put the following code into the OnAfterGetRecord of the “Purchase Header” data item of report 405:

CommentText := ‘’;
PurchaseCommentLine.SETRANGE(“Document Type”,PurchaseCommentLine.“Document Type”::Order);
PurchaseCommentLine.SETRANGE(“No.”,“No.”);
IF PurchaseCommentLine.FINDSET THEN
REPEAT
IF CommentText <> ‘’ THEN
CommentText := CommentText + ‘’; // backslash this is the NewLine Character for TextBoxes
CommentText := CommentText + PurchaseCommentLine.Comment;
UNTIL PurchaseCommentLine.NEXT = 0;

Then I put a textbox into the PageLoop Header section with the following properties:
Height = NoOfLines * 423
MultiLine = Yes
SourceExpression = CommentText

From this you can see a basic problem, because the height of the textbox cannot be changed dynamically. So the output is limited to some maximum NoOfLines from the “Purch. Comment Line” table. May be you can use an indented data item, if NoOfLines exceeds a certain value depending on where you put the textbox in the section, and print the remaining comment lines in a corresponding body section… - It may also be better practice to put the first comment lines, which have to be printed in the header section, into a text array with corresponding NoOfLines textboxes instead of putting them into one multiline textbox, because the code (and the section layout) would become more “readable” or “clearer”, respectively. Furthermore you would not have to take care of textoverflow, etc. if you would choose an array of Text80…