NAV Report

tonypangtonypang Member Posts: 101
Can anyone help me how to fix the report per page it 30 record?
If more move to the next page.
NAV

Comments

  • Manish_AhlawatManish_Ahlawat Member Posts: 31
    tonypang wrote:
    Can anyone help me how to fix the report per page it 30 record?
    If more move to the next page.

    You can count your records using a variable on OnAfterGetRecord()...

    when the count exceeds 30 use CurrReport.NEWPAGE

    Any issues with this, revert back...
    Rule from today: Never take others comment in a wrong way, these might help you to travel a long way in your carrier.
  • tonypangtonypang Member Posts: 101
    Please comment anything wrong here

    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.
    NAV
  • manluemanlue Member Posts: 30
    Hi tonypang,

    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.
  • tonypangtonypang Member Posts: 101
    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.
    NAV
  • manluemanlue Member Posts: 30
    Hi tonypang,

    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?).
  • Manish_AhlawatManish_Ahlawat Member Posts: 31
    tonypang wrote:
    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.
  • tonypangtonypang Member Posts: 101
    Do you how to get /set the first day of the month?

    example : t mean get today date.


    anybody can help me.
    NAV
  • superjetsuperjet Member Posts: 40
    1 day from date:
    MonthFirstDate := DMY2DATE(1,DATE2DMY(somedate,2), DATE2DMY(somedate,3));

    or if you know month and year then
    MonthFirstDate := DMY2DATE(1,int_month,int_year);
  • tonypangtonypang Member Posts: 101
    Thank you.
    One more question need to ask.
    How to get the last day of the month?
    NAV
  • tonypangtonypang Member Posts: 101
    Pls comment can i do like this?


    EndDate:=CALCDATE('+1M-1D',StartDate);
    EndDate mean to get the last day of the month.
    NAV
  • tonypangtonypang Member Posts: 101
    Please comment my code

    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.
    NAV
  • manluemanlue Member Posts: 30
    Maybe initialize "RecCount"-Variable in "OnInitReport"-trigger will help...
  • tonypangtonypang Member Posts: 101
    thank you.
    I SOLVED my problem
    NAV
  • tonypangtonypang Member Posts: 101
    Do you why when create the report data items need to use Integer ?
    Example
    Data items = Integer
    DataItemTableView=SORTING(Number) WHERE(Number=CONST(1))

    What this dataitem meaning for?

    Any body know about this ?
    NAV
  • manluemanlue Member Posts: 30
    Hi tonypang,

    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).
  • tonypangtonypang Member Posts: 101
    can you tell me by want situation need to use Integer at data items report ?
    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.
    NAV
  • manluemanlue Member Posts: 30
    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.
  • tonypangtonypang Member Posts: 101
    Good afternoon.
    Who know how to write the code to control the all the footer information show in bottom site?
    NAV
  • tonypangtonypang Member Posts: 101
    Report declare dataitem Integer name as KitSalesInvLine

    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.
    NAV
  • tonypangtonypang Member Posts: 101
    OnPush()

    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.
    NAV
  • idiotidiot Member Posts: 651
    Look at Report Selections for clues
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • tonypangtonypang Member Posts: 101
    thank you.
    NAV
  • tonypangtonypang Member Posts: 101
    Who know write the drill down code at request form to get the Journal Batch Name ?
    Please help me. Thank you
    NAV
  • tonypangtonypang Member Posts: 101
    how to link up both table ?
    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.
    NAV
  • tonypangtonypang Member Posts: 101
    thank you all the master here i found the solution le.
    Thank you.
    NAV
  • tonypangtonypang Member Posts: 101
    if i want to return the date as 25/01/2010
    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.
    NAV
  • manishgoyalmanishgoyal Member Posts: 52
    if u want to fix 30 record per page, then you use Integer table,and run it 30 times by apply setrange.
    Manish Goyal
Sign In or Register to comment.