Hi there,
I have a problem with a report that should be used as a reminder to the suppliers for items not yet delivered. This report has three data items (vendor with page break, purchase header and purchase line). The problem is that the report always prints the pages for the vendor... even if there a no purchase lines or purchase headers for that vendor.
I tried to use the following code to suppress the output if there are no entry lines for that supplier that still need to be delivered.
Lines.SETCURRENTKEY("Document Type","Pay-to Vendor No.","Currency Code");
Lines.SETRANGE("Document Type", Lines."Document Type"::Order);
Lines.SETRANGE("Buy-from Vendor No.", Vendor."No.");
Lines.SETRANGE("Outstanding Quantity", 0, 9999999);
Lines.SETRANGE(Type, Lines.Type::Item);
IF NOT Lines.FIND() THEN BEGIN
MESSAGE('Geen records gevonden');
CurrReport.SKIP;
END
I also used the SHOWOUTPUT part of the section code but that only made the output invisible... it did not suppress the page for that vendor without purchase lines. Any suggestions on how to setup the report so that only the records will be shown for suppliers that have purchase lines that meet the criteria.
CANE Microsoft Solutions BV
Prins Hendrikplein 14
2518 JC DEN HAAG
The Netherlands
http://www.cane.nl 0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
PrintOnlyIfDetail
http://www.BiloBeauty.com
http://www.autismspeaks.org
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
It works fine for suppliers where there is no purchase order at all. If there are purchase orders the header is always shown... Because I use the following statement in the OnPreSection statement...
CurrReport.SHOWOUTPUT(("Purchase Line"."Outstanding Quantity" > 0) AND ("Purchase Line".Type = "Purchase Line".Type::Item));
this influence the behavior and shows a header for those suppliers where no outstanding purchase lines are linked. It's too bad that you are not in a possition to use complex SQL statements with inner joins... that would fix this issue very easy... But I can not believe that there is not no solution for this problem... Any additional suggestions?
Prins Hendrikplein 14
2518 JC DEN HAAG
The Netherlands
http://www.cane.nl
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.