how to move to next line in 1 textbox (Report)?
julkifliman
Member Posts: 3
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
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
0
Comments
-
in some cases NAV is using "\" as a character for new line. But I am afraid that it will not work in youor scenario. NAV has no support for "multiline" edit boxes (you can enable multiline property, but this is just about "word wrapping").0
-
It can be done two ways as long as you can limit your comment lines to say"10" max
One is use an array and a page header loop
If you have the Purch comment line as a indented dataitem on the report for the Purch header add.
OnPreDataItem() //of thePurch Comment Line DataitemFOR i := 1 TO 10 DO CommentText[i] := ''; i:= 0;
OnAfterGetRecord()i := i + 1; CommentText[i] := Comment;
Create muliple pageloop, headers(1) & (2) etc to 10
in the sections->code addOnPreSection() IF CommentText[1] = '' THEN CurrReport.SHOWOUTPUT := FALSE;
on the pageloop header (2) addOnPreSection() IF CommentText[2] = '' THEN CurrReport.SHOWOUTPUT := FALSE;
Etc, Etc for 3 to 10
add a text box on each section sourceexp CommentText[1], 2 & 3 for each section.
it will allow 10 lines of comment text
I have a report that does this - i can post on the web & post the link if my explanation is not clear.
another ugly way, personally I would put this in a function "GetComments" and call it from the onaftergetrecord
getComments;FOR x := 1 TO 10 DO BEGIN PurchCommentLine.SETCURRENTKEY("Document Type","No.","Line No."); PurchCommentLine.SETFILTER(PurchCommentLine,"Document Type",PurchHeader."Document Type"); PurchCommentLine.SETFILTER(PurchCommentLine,"No.",PurchHeader."No."); IF PurchCommentLine.FIND('-') THEN REPEAT IF PurchCommentLine."Line No." = 10000 THEN text1 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 20000 THEN text2 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 30000 THEN text3 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 40000 THEN text4 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 50000 THEN text5 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 60000 THEN text6 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 70000 THEN text7 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 80000 THEN text8 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 90000 THEN text9 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 100000 THEN text10 := PurchCommentLine.Comment; UNTIL PurchCommentLine.NEXT=0; END;
*i guess i could use array to clean that code up :oops:
Then you can add a textbox with sourceexp text1+text2+text3..etc
Set tablebox to multiline=yes and make the box big.
one thing to monitor that if all the comments together are larger than the field can handle then you will get an error, unless you make multiple fields.
First array method prints the header then loops thru comment lines and add them one after the other - not showing output if it doesn't exist.
second method forces you to allocate space for the textboxes if the comment exist or not.
but it's always god to have more than 1 choice. as i said above i have a picking ticket that prints multiple comment lines (max10) i can share as an example if needed (uses array method)
I hope this is the thing you are trying to make happen???0 -
Savatage wrote:It can be done two ways as long as you can limit your comment lines to say"10" max
One is use an array and a page header loop
If you have the Purch comment line as a indented dataitem on the report for the Purch header add.
OnPreDataItem() //of thePurch Comment Line DataitemFOR i := 1 TO 10 DO CommentText[i] := ''; i:= 0;
OnAfterGetRecord()i := i + 1; CommentText[i] := Comment;
Create muliple pageloop, headers(1) & (2) etc to 10
in the sections->code addOnPreSection() IF CommentText[1] = '' THEN CurrReport.SHOWOUTPUT := FALSE;
on the pageloop header (2) addOnPreSection() IF CommentText[2] = '' THEN CurrReport.SHOWOUTPUT := FALSE;
Etc, Etc for 3 to 10
add a text box on each section sourceexp CommentText[1], 2 & 3 for each section.
it will allow 10 lines of comment text
I have a report that does this - i can post on the web & post the link if my explanation is not clear.
another ugly way, personally I would put this in a function "GetComments" and call it from the onaftergetrecord
getComments;FOR x := 1 TO 10 DO BEGIN PurchCommentLine.SETCURRENTKEY("Document Type","No.","Line No."); PurchCommentLine.SETFILTER(PurchCommentLine,"Document Type",PurchHeader."Document Type"); PurchCommentLine.SETFILTER(PurchCommentLine,"No.",PurchHeader."No."); IF PurchCommentLine.FIND('-') THEN REPEAT IF PurchCommentLine."Line No." = 10000 THEN text1 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 20000 THEN text2 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 30000 THEN text3 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 40000 THEN text4 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 50000 THEN text5 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 60000 THEN text6 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 70000 THEN text7 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 80000 THEN text8 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 90000 THEN text9 := PurchCommentLine.Comment; IF PurchCommentLine."Line No." = 100000 THEN text10 := PurchCommentLine.Comment; UNTIL PurchCommentLine.NEXT=0; END;
*i guess i could use array to clean that code up :oops:
Then you can add a textbox with sourceexp text1+text2+text3..etc
Set tablebox to multiline=yes and make the box big.
one thing to monitor that if all the comments together are larger than the field can handle then you will get an error, unless you make multiple fields.
First array method prints the header then loops thru comment lines and add them one after the other - not showing output if it doesn't exist.
second method forces you to allocate space for the textboxes if the comment exist or not.
but it's always god to have more than 1 choice. as i said above i have a picking ticket that prints multiple comment lines (max10) i can share as an example if needed (uses array method)
I hope this is the thing you are trying to make happen???
Ok thanks a lot Savatage
I changet my mind
i use array like you told me
I set there's only 5 line default for the comment
thank you for your answer
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
