My First Report

Hi,

I have read a lot on creating reports in the past few weeks and I felt ready to start with my first report; A picking list that would show the sales line where the line type is = to 0. This way we can use the description field to add comments.

Unfortunalty after less than 5 minutes[:^)]

The standard NAV report 10153 Picking List by Order uses DataItemTableView to filter all items with outstanding quantity <> 0. This is okay, but it also prevents any sales line of Type 0 from showing.

I have tried the lines below, but it filters everthing regardless of the line Type

IF “Sales Line”.Type = Type::Item THEN
“Sales Line”.SETFILTER(“Outstanding Quantity”, ‘<>0’);

Any help would be appreciated

Hi,

I assume you have removed the WHERE(Type=CONST(Item),Outstanding Quantity=FILTER(<>0)) from DataitemView property

SORTING(Document Type,Document No.,Line No.) WHERE(Type=CONST(Item),Outstanding Quantity=FILTER(<>0)), so that now your dataitemview has only

SORTING(Document Type,Document No.,Line No.)

Try these two:

  1. OnAfterGetRecord trigger write the following code:

IF NOT ((“Sales Line”.Type = Type::Item) AND (“Sales Line”.“Outstanding Quantity”<>0))THEN

CurrReport.SKIP

or

  1. Sales Line, Body (1) - OnPreSection()

IF NOT ((“Sales Line”.Type = Type::Item) AND (“Sales Line”.“Outstanding Quantity”<>0))THEN

CurrReport.SHOWOUTPUT(FALSE);

The suggested code did it! (I did however removed the NOT and changed <>0 to =0)

IF ((“Sales Line”.Type = Type::Item) AND (“Sales Line”.“Outstanding Quantity” =0)) THEN

CurrReport.SKIP

Thank you very much