Report DataItemTableView

bhalpinbhalpin Member Posts: 309
Hi.

In Report 10077, Sales Shipment, I want to set a filter on Sales Shipment Line to print lines where the quantity <> 0 OR No. = ''.

In other words, skip lines where the quantity is zero, but I want 'comment' lines to print (lines where No. is blank.)

In the "Sales Shipment Line" properties, DataItemTableView I want to put in something like:
Quantity=FILTER(<>0) | No.=FILTER(<>'')

but of course I can't.

Any suggestions on how I can accomplish this?

Thank's in advance.

Bob

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    The way to do this, is to go to the OnPreSection (menu View, Sections, F9 to go to OnPreSection).

    Comment lines are lines where type = type::" ".
    And you don't (NOT) want to print lines where type = type::Item and quantity = 0.
    CurrReport.SHOWOUTPUT(NOT(type=type::item AND quantity=0));
    

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • bbrownbbrown Member Posts: 3,268
    Be careful about using "not equal to" filters if working with SQL. These can result in table or index scans and can impact performance with large datasets.
    There are no bugs - only undocumented features.
  • bhalpinbhalpin Member Posts: 309
    Thank's for the reply & tip.

    I got something to work and came back to post what I did:
    Sales Shipment Line - OnAfterGetRecord()
    IF ("Sales Shipment Line".Quantity = 0) AND ("Sales Shipment Line"."No." <> '') THEN
      CurrReport.SKIP;
    

    It works, but doesn't look as elegant as the solution above.

    Bob
Sign In or Register to comment.