Options

Copy filter of data item to a global record variable

tortmanntortmann Member Posts: 3
Hey there,

does anybody know a possibility to copy the filter of an intended data item to a global record variable in the OnPreReport Trigger? The GETFILTERS is not very helpful, I think, because it doesn't return a "real" filter string. A possibility is to use the getfilter, but then i have to hard code the field names and i want to code a function, that i can use in any report for any data item.

Any Ideas?

Thanx in advance
tobias

Comments

  • tortmanntortmann Member Posts: 3
    COPYFILTERS

    Sorry for the spam :-)
  • eromeineromein Member Posts: 589
    or COPY.

    "Use this function to copy a record from a C/SIDE table. All filters, marks, and keys are included in the copy."
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • Christian_BuehlChristian_Buehl Member Posts: 145
    I have had a similar problem.
    I wanted the user not to bother with too much input tabs.
    I added a dummy table as first table where the filters can be set by the customer.
    The first statement in OnAfterGetRecord is CurrReport.break as it is only used to get the filters.
    In the OnPreDataItem of each further table I used copyfilters or did it with setfilter/getfilter.
    prefilter    (table "G/L Account")
    "Dimension Value"    (no indent)
    -->  "G/L Account"     (indented to "Dimension Value")  
    -----
    "Dimension Value"-OnPreDataItem
    "Dimension Value".SETFILTER("Dimension Value".Code,prefilter.GETFILTER(prefilter."Global Dimension 1 Filter"));
    
    "G/L Account" OnPreDataItem
    "G/L Account".COPYFILTERS(prefilter);
    "G/L Account".SETFILTER("Global Dimension 1 Filter","Dimension Value".GETFILTER("Dimension Value".Code));
    


    :mrgreen:
  • DnealDneal Member Posts: 103
    Thanks Christian Buehl, this is exactly what I needed! Works perfectly!

    Dneal
Sign In or Register to comment.