Using Filter

twctwc Member Posts: 28
Hello,

I defined a Item Tab in the Selection Dialog.
Then I save the filters in "Report - OnPreReport()":
re_Item.COPYFILTERS(Item);
te_ItemNoFlt := Item.GETFILTER("No.");
The Report does a loop on the "Purchase Line" table.
How can I apply the filter?
I tried the following code in "Purchase Line, Body (7) - OnPreSelection()":
IF te_ItemNoFlt <> '' THEN BEGIN
  CurrReport.SHOWOUTPUT( ?????? );
END ELSE BEGIN
  re_Item.SETRANGE("No.", "Purchase Line"."No.");
  CurrReport.SHOWOUTPUT(re_Item.FIND);
END;
But I can not complete it.
Does someone has an Idea?

Thank you and Regards,
Tommaso
Tommaso Cereghetti
IT-Consultant

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Do you want to print the purchase lines only when the item is in the itemfilter?

    The easiest way to go I think is to first put all the items in the filter in a temporary table.

    Then you can skip the lines when the item is not in this temp table.
  • twctwc Member Posts: 28
    The problem is that there are also filter on the purchase line, and I should decide whether I should print a creditor or not.

    Is there a command to test if a value satisfies a given filter?
    Tommaso Cereghetti
    IT-Consultant
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I'm affraid there is no easy function for that. :(
  • twctwc Member Posts: 28
    Now I use the temporary table only in case the Item."No." filter not-empty is.

    Thank you very much also for the answer on the other topic!

    Regards,
    Tommaso
    Tommaso Cereghetti
    IT-Consultant
Sign In or Register to comment.