Hi All
How to call comments from purchase header in a report--Purchase order report??
I want to call it in an integer data item.
I tried using setrange on document type and No. but it didn't work.
Kindly tell me asap.
Thanx
new DataItem over table "Purch. Comment Line". Link this dataItem with your Header (for linking see the RunFormLink behind the Comment CommandButton on Purch. Order.
I forgot to tell u but I am using "Purch. Comment Line".
I am using setrange b/w "document no." of Purch. Comment line and "No." of Purchase header and I have created a text type variable on report and I am putting the value of "Purch. Comment Line".Comments in the text type field that I have created.
But,I am not able to print it .
Can u suggest the code??
Purchase Header
-Purchase Line
-Purch. Comment Line
in the properties of Purch. Comment Line set the DataItemLink to
Document Type to Purchase Header Document Type
No. to Purchase Header No.
Hope this helps
Albert
Thanx 4 the solution but i don't want to declare a new data item.I want to do it by declaring a datatype record for "Purch. Comment Line."
I hope u understand.
Well if your comments are all 1 liners there is no problem but if there is more than one how are you going to print these?
OnAfterGetRecord of Purchase Header
PurchCommentLine.SETRANGE("Document Type","Document Type");
PurchCommentLine.SETRANGE("No.","No.");
IF NOT PurchCommentLine.FINDFIRST THEN
CLEAR(PurchCommentLine);
According to technical standards u should first try to declare a data item.
I am really not aware of this standard. If you can give a reference for that or put your Idea for that cogently, It would be really great. :-k
I would suggest that dataItem is more faster and cleaner way of scanning records from a table and printing them in the section of reports. [-(
Also,for printing 1 field we should'nt create a dataitem.
Based on the assumption that you never have more than one comment lines for purchase line, using a rec variable for purch. comment line is OK.
however if we can not assume that,....though that can be handeled in an unclean way, using a rec variable is not at all suggestable. [-(
Sandeep Prajapati Technical Consultant, MS Dynamics NAV
Hi
I am now facing the problem of printing single line and multiple lines.
Singles are printed but multiples are not(only 1st was printed.)
Shall i try "on after getrecord "for purchase header .
Suggest me something.
Thanx
if you want 1 line then it's easy
if you want a number of possible comments lines then the complexity is increased. Just the way it is.
you add the sales comment line as a dataitem link to the sales header
OnPreDataItem()
FOR i := 1 TO 10 DO
CommentText[i] := '';
i:= 0;
OnAfterGetRecord()
i := i + 1;
CommentText[i] :=
'******************************************************************************************************************';
IF (STRLEN(Comment) < STRLEN(CommentText[i])) THEN
CommentText[i] := Comment + COPYSTR(CommentText[i],1,(STRLEN(CommentText[i]) - STRLEN(Comment)))
ELSE
CommentText[i] := Comment;
View Sections , create pageloop header
OnPreSection()
IF CommentText[1] = '' THEN
CurrReport.SHOWOUTPUT := FALSE;
on the next section
OnPreSection()
IF CommentText[2] = '' THEN
CurrReport.SHOWOUTPUT := FALSE;
etc
etc.
I guess you could hard code it with variables. :-k
PurchComment.SETCURRENTKEY(..fill in..);
PurchComment.SETFILTER(...fill in..);
IF PurchComment.FIND('-') THEN
REPEAT
IF PurchComment."Line No." = 10000 THEN text1 := PurchComment.Textline;
IF PurchComment."Line No." = 20000 THEN text2 := PurchComment.Textline;
IF PurchComment."Line No." = 30000 THEN text3 := PurchComment.Textline;
IF PurchComment."Line No." = 40000 THEN text4 := PurchComment.Textline;
IF PurchComment."Line No." = 50000 THEN text5 := PurchComment.Textline;
IF PurchComment."Line No." = 60000 THEN text6 := PurchComment.Textline;
IF PurchComment."Line No." = 70000 THEN text7 := PurchComment.Textline;
IF PurchComment."Line No." = 80000 THEN text8 := PurchComment.Textline;
IF PurchComment."Line No." = 90000 THEN text9 := PurchComment.Textline;
IF PurchComment."Line No." = 100000 THEN text10 := PurchComment.Textline;
UNTIL PurchComment.NEXT=0;
END;
Ok now you have 10 lines of comments all in different text variables from text1 to text10
you can now add these fields to a section.
I still like the array method. note this method requires you to force a number of lines unless you want to get crazy and add 100
if you import the report you will see each array[x]
is on it's own line and if the line is blank the showoutput is false.
I guess you can do this too for the hardcoded one.
Note that it's a pageloop based on the header
loop1..
Main header
loop2..
Header comment1
loop3..
header comment 2
loop4..
header comment 3
etc
etc
IF CommentText[1] = '' THEN
CurrReport.SHOWOUTPUT := FALSE;
if you want 1 line then it's easy
if you want a number of possible comments lines then the complexity is increased. Just the way it is.
you add the sales comment line as a dataitem link to the sales header
OnPreDataItem()
FOR i := 1 TO 10 DO
CommentText[i] := '';
i:= 0;
OnAfterGetRecord()
i := i + 1;
CommentText[i] :=
'******************************************************************************************************************';
IF (STRLEN(Comment) < STRLEN(CommentText[i])) THEN
CommentText[i] := Comment + COPYSTR(CommentText[i],1,(STRLEN(CommentText[i]) - STRLEN(Comment)))
ELSE
CommentText[i] := Comment;
View Sections , create pageloop header
OnPreSection()
IF CommentText[1] = '' THEN
CurrReport.SHOWOUTPUT := FALSE;
on the next section
OnPreSection()
IF CommentText[2] = '' THEN
CurrReport.SHOWOUTPUT := FALSE;
etc
etc.
I guess you could hard code it with variables. :-k
PurchComment.SETCURRENTKEY(..fill in..);
PurchComment.SETFILTER(...fill in..);
IF PurchComment.FIND('-') THEN
REPEAT
IF PurchComment."Line No." = 10000 THEN text1 := PurchComment.Textline;
IF PurchComment."Line No." = 20000 THEN text2 := PurchComment.Textline;
IF PurchComment."Line No." = 30000 THEN text3 := PurchComment.Textline;
IF PurchComment."Line No." = 40000 THEN text4 := PurchComment.Textline;
IF PurchComment."Line No." = 50000 THEN text5 := PurchComment.Textline;
IF PurchComment."Line No." = 60000 THEN text6 := PurchComment.Textline;
IF PurchComment."Line No." = 70000 THEN text7 := PurchComment.Textline;
IF PurchComment."Line No." = 80000 THEN text8 := PurchComment.Textline;
IF PurchComment."Line No." = 90000 THEN text9 := PurchComment.Textline;
IF PurchComment."Line No." = 100000 THEN text10 := PurchComment.Textline;
UNTIL PurchComment.NEXT=0;
END;
Ok now you have 10 lines of comments all in different text variables from text1 to text10
you can now add these fields to a section.
I still like the array method. note this method requires you to force a number of lines unless you want to get crazy and add 100
Comments
Regards
Use table 43 Purch. Comment Line
Albert
I forgot to tell u but I am using "Purch. Comment Line".
I am using setrange b/w "document no." of Purch. Comment line and "No." of Purchase header and I have created a text type variable on report and I am putting the value of "Purch. Comment Line".Comments in the text type field that I have created.
But,I am not able to print it .
Can u suggest the code??
I take it you have something like this
Purchase Header
-Purchase Line
-Purch. Comment Line
in the properties of Purch. Comment Line set the DataItemLink to
Document Type to Purchase Header Document Type
No. to Purchase Header No.
Hope this helps
Albert
I hope u understand.
OnAfterGetRecord of Purchase Header
PurchCommentLine.SETRANGE("Document Type","Document Type");
PurchCommentLine.SETRANGE("No.","No.");
IF NOT PurchCommentLine.FINDFIRST THEN
CLEAR(PurchCommentLine);
Albert
Technical Consultant, MS Dynamics NAV
According to technical standards u should first try to declare a data item.
Also,for printing 1 field we should'nt create a dataitem.
If I am wrong please correct me.
Thanx
I would suggest that dataItem is more faster and cleaner way of scanning records from a table and printing them in the section of reports. [-( Based on the assumption that you never have more than one comment lines for purchase line, using a rec variable for purch. comment line is OK.
however if we can not assume that,....though that can be handeled in an unclean way, using a rec variable is not at all suggestable. [-(
Technical Consultant, MS Dynamics NAV
Technical Consultant, MS Dynamics NAV
Sorry it ws a mistake.
first we should try to create a variable.
Sorry
If I may ask, when you attempted to use an Integer DataItem to list the, possible several, comments what kind of output were you getting?
As stated above - how many comment lines do you want to be able to handle?
http://www.BiloBeauty.com
http://www.autismspeaks.org
I am now facing the problem of printing single line and multiple lines.
Singles are printed but multiples are not(only 1st was printed.)
Shall i try "on after getrecord "for purchase header .
Suggest me something.
Thanx
Use array to store your comments and display each line of the array n a different header section.
see this for better idea.
http://savatage99.googlepages.com/10153 ... yOrder.txt
http://www.BiloBeauty.com
http://www.autismspeaks.org
I dont think that calling multiple line comments on a report is that complex.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I am really thakful for your suggestion BUT can I get some easier way 2 do it?
Do you mean ....an easier way without using a purch. comment line DataItem ... :?:
Technical Consultant, MS Dynamics NAV
if you want a number of possible comments lines then the complexity is increased. Just the way it is.
you add the sales comment line as a dataitem link to the sales header
View Sections , create pageloop header on the next section
I guess you could hard code it with variables. :-k
Ok now you have 10 lines of comments all in different text variables from text1 to text10
you can now add these fields to a section.
I still like the array method. note this method requires you to force a number of lines unless you want to get crazy and add 100
http://www.BiloBeauty.com
http://www.autismspeaks.org
How about the spacing of the report output? Is there a way to make the section grow and shrink based on number of comment lines?
Rename OBJECT Report 10153 Picking List by Order
to a number you have avaialable
if you import the report you will see each array[x]
is on it's own line and if the line is blank the showoutput is false.
I guess you can do this too for the hardcoded one.
Note that it's a pageloop based on the header
loop1..
Main header
loop2..
Header comment1
loop3..
header comment 2
loop4..
header comment 3
etc
etc
if i have a sec i'll move it to a purch report.
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://savatage99.googlepages.com/50072 ... mments.txt
here's a fob it you can't import the text file
http://savatage99.googlepages.com/50072 ... mments.fob
Only took a min or two so it's not that complicated.
the report is designed to
->Print the header
-->Print 1 to 10 comment lines
--->print purchase lines
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanx ma'an
The idea is pretty good
did you download & look at this?
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanx