Creating a report

sbillysbilly Member Posts: 231
I want to create a report that displays number of sales orders and the number of their sales lines for each customer, between tow dates ( posting date):
Like this:

Customers | No. Orders | No. Lines

Customer1 | 66 | 220
Customer2 | 1 | 5

Any ideas of the dispoition of data item?

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    What did you try as of now and what problem you are facing..
  • vijay_gvijay_g Member Posts: 884
    Take a dataitem of Customer and write it on onafterget trigger
    Nooforder := 0;
    NoofLine := 0;
    SalesHeader.SETCURRENTKEY("Posting Date","Sell-to Customer No.");
    SalesHeader.SETRANGE("Posting Date",StartDate,EndDate);
    SalesHeader.SETRANGE("Sell-to Customer No.",Customer."No.");
    Nooforder := SalesHeader.Count;
    IF SalesHeader.FINDSET THEN REPEAT
       SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");
       SalesLine.SETRANGE("Document No.",SalesHeader."No.");
       NoofLine += SalesLine.Count;
    UNTIL SalesHeader.NEXT=0;
    
  • sbillysbilly Member Posts: 231
    This's the disposition I tried:
    DataItem Name
    Customer <Customer>
    Archived Sales Header <Archived Sales Header>
    Archived Sales Line <Archived Sales Line>
    I used the flowfield "No. Of Orders", but I have a problem with the Number of sales line.
    My second problem is that I can't calculate the flowfield "No. Of Orders" depending on the posting date.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You can add Posting date=FIELD(Date Filter) in No. Of Orders field calcformula..

    What problem you have in Sales Lines?
  • sbillysbilly Member Posts: 231
    vijay_g wrote:
    Take a dataitem of Customer and write it on onafterget trigger
    Nooforder := 0;
    NoofLine := 0;
    SalesHeader.SETCURRENTKEY("Posting Date","Sell-to Customer No.");
    SalesHeader.SETRANGE("Posting Date",StartDate,EndDate);
    SalesHeader.SETRANGE("Sell-to Customer No.",Customer."No.");
    Nooforder := SalesHeader.Count;
    IF SalesHeader.FINDSET THEN REPEAT
       SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");
       SalesLine.SETRANGE("Document No.",SalesHeader."No.");
       NoofLine += SalesLine.Count;
    UNTIL SalesHeader.NEXT=0;
    
    Thank you very well =D> :D
Sign In or Register to comment.