copying filters between two data items in a report

anuragatishanuragatish Member Posts: 48
Hi friends,

I have a report that has two data items.
All the filters applied on data item 1 at run time have to be applied as it is on data item 2 also.

i tried using getfilters on first data item. but can't set that on second data item.

regards
Anurag
Technical Consultant
Anurag atish
Navision Technical Consultant
Bangalore
anurag.atish@yahoo.com

Comments

  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    Hi

    Try this code
    diItem1 := diItem2;
  • krikikriki Member, Moderator Posts: 9,110
    If both Dataitems work on the same table, you can best use
    "Table DataItem2".COPYFILTERS("Table DataItem2");
    
    This code you need to put in the OnPreReport-trigger.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • anuragatishanuragatish Member Posts: 48
    kirki,

    the data items are for two different tables. But have most of the fields common

    dataitem 1 : Sales Invoice Header
    dataitem 2 : Sales Cr. memo Header

    i have to apply the filters set on dataitem 1 to dataitem 2.
    Anurag atish
    Navision Technical Consultant
    Bangalore
    anurag.atish@yahoo.com
  • SrikalSrikal Member Posts: 17
    If they are dependent on each other (indented ) then u can use the same filters

    else
    if they r independent, then simply use the option (request form ) and force the user to enter the filters and simply apply the same on both the dataitems.

    (Dont open each dataitem required filter fileds option to the users. )
  • anuragatishanuragatish Member Posts: 48
    thanks buddy,

    i have already done that...

    looks like there is no other way out...

    anyways thanks again...
    Anurag atish
    Navision Technical Consultant
    Bangalore
    anurag.atish@yahoo.com
  • krikikriki Member, Moderator Posts: 9,110
    The other way is to copy the filters field by field in the OnPreReport-trigger.

    "Sales Cr.Memo Header".setfilter("No.","Sales Invoice Header".getfilter("No."));
    "Sales Cr.Memo Header".setfilter("Sell-to Customer No.","Sales Invoice Header".getfilter("Sell-to Customer No."));
    "Sales Cr.Memo Header".setfilter("posting Date","Sales Invoice Header".getfilter("posting Date"));
    ...
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.