Options

Print Textbox in Header or Not in a Report

elToritoelTorito Member Posts: 191
Hi,

when i print a Report (204) it will puts out a headerline on top oif the sales lines, thats nice :) (Boxes in the Roundloop Header (1) )

In The Header Line it will be out "Discount %" , but if in the Order/Offer don't give Discount it will be write out the Text "Discount %" .

What must I Do if i only would be out the Header line if in one sales line is given a sales discount?

I have try make it so:
In DataItem RoundLoop, in On Pre DataItem ZTrigger i put follow code:
IF SalesLine."Line Discount %"<>0 THEN BEGIN
  DiscountExists := TRUE;
END ELSE BEGIN
  DiscountExists := FALSE;
END;

Then in Section(RoundLoop Header and ROundLoopTransHeader)
i put follow code:
before i give the textbox a name so that i can write him some string.
IF DiscountExists := TRUE THEN BEGIN
  str_Discount := 'Discount %';
END ELSE BEGIN
  str_Discount := '';
END;

But this only works if given a discount in sales line 1.

Perhaps anybody has a tip for me who i can solucioned it.

Thanks.
(Oo)=*=(oO)

Comments

  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Try this code in the DataItem RoundLoop, in On PreDataItem Trigger
    (define a new global var: recSalesLine as Record with subtype Sales Line):
    recSalesLine.SETRANGE("Document Type",SalesLine."Document Type");
    recSalesLine.SETRANGE("Document No.",SalesLine."Document No.");
    recSalesLine.SETFILTER("Line Discount %",'<>%1',0);
    DiscountExists := recSalesLine.FIND('-');
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    elToritoelTorito Member Posts: 191
    Hello Luc,

    this code works good. \:D/

    Thank you.

    Peter
    (Oo)=*=(oO)
Sign In or Register to comment.