"Sales Invoice Line".SETRANGE("Document No.","Sales Invoice Header"."No.");
IF "Sales Invoice Line".FIND('-') THEN
REPEAT
RecCount:= RecCount +1 ;
IF RecCount>30 THEN
BEGIN
CurrReport.NEWPAGE;
RecCount:=0;
END
UNTIL "Sales Invoice Line".NEXT = 0;
When i run it first page become blank
second page show one line only.
Thank you.
if you like to print every "Sales Invoice Line" you have to create an indented data item for it in your report under the "Sales Invoice Header" data item. Then in section "Sales Invoice Line"-OnAfterGetRecord you may increase the "RecCount"-Variable. Then check if RecCount is greater than 30 and code "CurrReport.NEWPAGE". Don't forget to reset "RecCount"-Variable in this condition-check. Think that every Record of your "Sales Invoice Line"-Table has to run its own "OnAfterGetRecord"-Section to get printed...
What you did is only to count the lines in one section. Executing comes in this section, counts "Sales Invoice Line"-Records, as there are more than 30 it executes a NEWPAGE command (so your first page is empty) and if all lines are counted the section is left and one line is printed.
in indented data item "Sales Invoice Line" call properties and set "DataItemLinkReference" to "Sales Invoice Header" and set "DataItemLink" to "Document No.=FIELD(No.)". This provides you get all Invoice Lines only of the actual Invoice Header. Then in Report you have a section "Sales Invoice Line - OnAfterGetRecord" where you may do the increasing of "RecCount"-Variable and condition check.
In Report Sections there have to be a Section "Sales Invoice Line - Body" which will be responsible to print out line matter.
For more info refer to standard Invoice Report (206?).
But i already create on indent data item under ales Invoice Header name as ales Invoice Line
But they still can't work?
Can you guide me how to do it.
Because i just in beginning level to learn this language.
Thank you.
You need to use a variable and increment it on OnAfterRecord(), so it will keep printing the records not just count them..
then when the count exceeds 30 you insert the newpage command which will mean that you would get those 30 records before control shifts to next page...
it would be like...
variable x;(needs to count records)
OnAftergetRecord
x+=1;
if x > 30 then begin
CurrReport.NEWPAGE;
x:=0;
end;
try something like this and then revert back..
Best of luck
Rule from today: Never take others comment in a wrong way, these might help you to travel a long way in your carrier.
Do you why when create the report data items need to use Integer ?
Example
Data items = Integer DataItemTableView=SORTING(Number) WHERE(Number=CONST(1))
I think you are regarding standard reports, f.e. Sales Invoice Report. In this Reports not only Header and Lines are printed (and have own DataItems) but there is functionality in to handle different layout for first page / following pages and printing copies. For this case the DataItems "Integer" are built in. One integer in this case handles if first page is yet printed and one integer counts the number of copies. Thats basis info I hope will help, for detailed info please refer to NAV documentation (f.e. Application Designers Guide - to find on product cd).
Remember if you use a record dataitem the code and the sections/output and indented dataitems will be processed for each record found.
If you like to have processing independet from a number of records in a "normal" table the integer dataitem will grant you this possibility. It's used like a table (look at the properties of such a dataitem) having records with field "Number": 1,2,3,..... and you are able to limit the records simply by filtering "Number" in this "integer table". Have a look at the CopyLoop Code in the standard reports for example.
OnAfter
IF Number = 1 THEN
TempKitSalesInvLine.FINDSET
ELSE
TempKitSalesInvLine.NEXT;
{IF (IntLineCount DIV MaxLineNo > 0) AND (IntLineCount MOD MaxLineNo = 0) THEN BEGIN
IntLineCount := 0;
CurrReport.NEWPAGE;
END;
}
Hello all master here can you explain to me What meaning of this part of the code ?
Comments
You can count your records using a variable on OnAfterGetRecord()...
when the count exceeds 30 use CurrReport.NEWPAGE
Any issues with this, revert back...
RecCount:=0;
"Sales Invoice Line".SETRANGE("Document No.","Sales Invoice Header"."No.");
IF "Sales Invoice Line".FIND('-') THEN
REPEAT
RecCount:= RecCount +1 ;
IF RecCount>30 THEN
BEGIN
CurrReport.NEWPAGE;
RecCount:=0;
END
UNTIL "Sales Invoice Line".NEXT = 0;
When i run it first page become blank
second page show one line only.
Thank you.
if you like to print every "Sales Invoice Line" you have to create an indented data item for it in your report under the "Sales Invoice Header" data item. Then in section "Sales Invoice Line"-OnAfterGetRecord you may increase the "RecCount"-Variable. Then check if RecCount is greater than 30 and code "CurrReport.NEWPAGE". Don't forget to reset "RecCount"-Variable in this condition-check. Think that every Record of your "Sales Invoice Line"-Table has to run its own "OnAfterGetRecord"-Section to get printed...
What you did is only to count the lines in one section. Executing comes in this section, counts "Sales Invoice Line"-Records, as there are more than 30 it executes a NEWPAGE command (so your first page is empty) and if all lines are counted the section is left and one line is printed.
But they still can't work?
Can you guide me how to do it.
Because i just in beginning level to learn this language.
Thank you.
in indented data item "Sales Invoice Line" call properties and set "DataItemLinkReference" to "Sales Invoice Header" and set "DataItemLink" to "Document No.=FIELD(No.)". This provides you get all Invoice Lines only of the actual Invoice Header. Then in Report you have a section "Sales Invoice Line - OnAfterGetRecord" where you may do the increasing of "RecCount"-Variable and condition check.
In Report Sections there have to be a Section "Sales Invoice Line - Body" which will be responsible to print out line matter.
For more info refer to standard Invoice Report (206?).
You need to use a variable and increment it on OnAfterRecord(), so it will keep printing the records not just count them..
then when the count exceeds 30 you insert the newpage command which will mean that you would get those 30 records before control shifts to next page...
it would be like...
variable x;(needs to count records)
OnAftergetRecord
x+=1;
if x > 30 then begin
CurrReport.NEWPAGE;
x:=0;
end;
try something like this and then revert back..
Best of luck
example : t mean get today date.
anybody can help me.
MonthFirstDate := DMY2DATE(1,DATE2DMY(somedate,2), DATE2DMY(somedate,3));
or if you know month and year then
MonthFirstDate := DMY2DATE(1,int_month,int_year);
One more question need to ask.
How to get the last day of the month?
EndDate:=CALCDATE('+1M-1D',StartDate);
EndDate mean to get the last day of the month.
RecCount+=1;
IF RecCount > 19 THEN BEGIN
CurrReport.NEWPAGE;
RecCount:=0;
END;
Why my first page of is blank?
Follow the next page per record is 20 all is correct.
I SOLVED my problem
Example
Data items = Integer
DataItemTableView=SORTING(Number) WHERE(Number=CONST(1))
What this dataitem meaning for?
Any body know about this ?
I think you are regarding standard reports, f.e. Sales Invoice Report. In this Reports not only Header and Lines are printed (and have own DataItems) but there is functionality in to handle different layout for first page / following pages and printing copies. For this case the DataItems "Integer" are built in. One integer in this case handles if first page is yet printed and one integer counts the number of copies. Thats basis info I hope will help, for detailed info please refer to NAV documentation (f.e. Application Designers Guide - to find on product cd).
Why need to use it ?
When need to use it ?
because i still fresh of this NAV. so that i need all of your help me.
Thank you so much.
If you like to have processing independet from a number of records in a "normal" table the integer dataitem will grant you this possibility. It's used like a table (look at the properties of such a dataitem) having records with field "Number": 1,2,3,..... and you are able to limit the records simply by filtering "Number" in this "integer table". Have a look at the CopyLoop Code in the standard reports for example.
Who know how to write the code to control the all the footer information show in bottom site?
OnPre()
TempKitSalesInvLine.DELETEALL;
KitManagement.GetKitSalesInvLinesToPrint("Sales Invoice Line",TempKitSalesInvLine);
TempKitSalesInvLine.SETRANGE(Type,TempKitSalesInvLine.Type::Item);
SETRANGE(Number,1,TempKitSalesInvLine.COUNT);
OnAfter
IF Number = 1 THEN
TempKitSalesInvLine.FINDSET
ELSE
TempKitSalesInvLine.NEXT;
{IF (IntLineCount DIV MaxLineNo > 0) AND (IntLineCount MOD MaxLineNo = 0) THEN BEGIN
IntLineCount := 0;
CurrReport.NEWPAGE;
END;
}
Hello all master here can you explain to me What meaning of this part of the code ?
Thank you so much.
CurrForm.SETSELECTIONFILTER(SalesInvHeader);
SalesInvHeader.PrintRecords(TRUE);
When click Print button is link to my report 206.
But i check other Print button same code but they link to 50005?
How to understand this kind of linking ?
If anybody know how to explain please help me.
ERP Consultant (not just Navision) & Navision challenger
Please help me. Thank you
is it like this ?
SETRANGE("Item No.",NWhseBinLoc."Item No");
this code i put at predataitem.
But it not work
Why?
anybody can help me.
Thank you.
how to format this kind of the format ?
Example:
Format(today,0,4) date return format is 21 January 10
Anybody master here can help me?
On the other hand where can we get the all the date setting ?
Thank you.