Options

Suppress report pages

harm.poelenharm.poelen Member Posts: 36
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

Comments

  • Options
    kinekine Member Posts: 12,562
    See DataItem property OnlyIfDetails...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    SavatageSavatage Member Posts: 7,142
    kine wrote:
    See DataItem property OnlyIfDetails...

    PrintOnlyIfDetail
    :D
  • Options
    kinekine Member Posts: 12,562
    Ok, Ok, I used my memory instead Navision, it was faster but not exact... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    harm.poelenharm.poelen Member Posts: 36
    I must regret to say that this solution did not work. :|
    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?
    CANE Microsoft Solutions BV
    Prins Hendrikplein 14
    2518 JC DEN HAAG
    The Netherlands
    http://www.cane.nl
  • Options
    kinekine Member Posts: 12,562
    You must set same property for the header... if the header will be not showen, the vendor will be not showen too...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.