Programmatically manipulate a filter on a report

josephdeweyjosephdewey Member Posts: 87
Hi All,

I know how to manipulate the values on the Request Form on a report, that I'm calling from a Codeunit. Here's an example of an InitializeRequest function, that sets values on the report Request Form.
InitializeRequest(NewPostMethod : Option;NewDocNo : Code[20];NewPost : Boolean)
PostMethod := NewPostMethod;
DocNo := NewDocNo;
Post := NewPost;

I'm wondering how to change my code so that I can manipulate the filter on the report. The table that my report is based on is the Sales Header table.
Joseph Dewey
Microsoft Dynamics NAV User

Comments

  • yukonyukon Member Posts: 361
    Hi josephdewey,

    Is it this one what you want?
    recSalesHdr.setrange("Document Type",1);
    recSalesHdr.setrange(recSalesHdr."Customer Posting Group",'DOMESTIC');
    //recSalesHdr.setrange(Field,Your-Filter Value);
    //recSalesHdr.setrange(Field,Your-Filter Value);
    //recSalesHdr.setrange(Field,Your-Filter Value);
    rpt.USEREQUESTFORM := TRUE;
    rpt.SETTABLEVIEW(recSalesHdr);
    rpt.RUN;
    

    Regards,
    Yukon
    Make Simple & Easy
Sign In or Register to comment.