Report Generation

sridharsridhar Member Posts: 171
I have an exercise where in I have to view all the customers placed an sales order.

I have used two tables, Customer and Sales Header(Intended).
I have set the DataItemLink ("Sell-to Customer No." of Sales Header and "No." of Customer Table).

But I m getting the list of all the customer. I want to see only the Customers who were placed the sales orders.

what I have to do?

Comments

  • admoretutsieadmoretutsie Member Posts: 79
    In your second Dataitem, set the property PrintOnlyIfDetail to true.
    $cside -MBS
    >install Navision::4.0 SP1
    >q
    $
    oOo
  • sridharsridhar Member Posts: 171
    Thanks,

    I tried it, even then I am not getting the exact result.

    N.Sridhar
  • admoretutsieadmoretutsie Member Posts: 79
    In that case, l think we have to do some bit of coding...l cannot think of another solution at the moment. So it goes like so.
    Get rid og the second dataitem and declare a record VAR of subtype SAles Header(SHeader), and onaftergetrecord of the first item, setfilter(No.,Sell-to-Cust). Now check, if Sheader.COUNT = 0, then currreport.skip.

    That must give you Customers that hav placed orders.

    I hope l am getting your requirement clearly.
    $cside -MBS
    >install Navision::4.0 SP1
    >q
    $
    oOo
  • FPulsfortFPulsfort Member Posts: 43
    Hi Sridhar,

    you can do it with setting PrintOnlyIfDetail to true, but you have to set it in the first dataitem. This should do the work.

    Regards,
    Frank
  • themavethemave Member Posts: 1,058
    Just switch the order of your tables, so that Sales Invoice header is the first table and Customer is the second, This way it goes through all Sales invoice headers and pulls the appropriate customer info.

    your method is going through all customers and seeing if there is a sales invoice header.
  • AndreasBucherAndreasBucher Member Posts: 18
    Thanks, was exactly what i was looking for :-)!!!!
  • sggsgg Member Posts: 109
    what if u do something like this:

    Have 1 DataItem (Customer)
    Create a Variable SHeader (Sales Header)

    OnAfterGetRecord of Customer DataItem add the following:


    SHeader.Reset;
    SHeader.Setrange("Sell-To-Customer No.",Customer."No.");
    if not SHeader.find('-') Then CurrReport.Skip
    Sunday, Godwin G
Sign In or Register to comment.