Run Report Account Schedule from code

kenlkenl Member Posts: 182
Hello,

I would like to run the Report Account Schedule in a code unit (without a user request form)

I have the following code:

Name DataType Subtype Length
AccountSchedule Report Account Schedule
  AccountSchedule.SetAccSchedName('ANALYSIS');
  AccountSchedule.SetColumnLayoutName('Default');
  AccountSchedule.SetFilters('01/01/05..12/01/05', '', '', AA', 'AA..', '', '');
  AccountSchedule.InitAccSched;
  AccountSchedule.USEREQUESTFORM(FALSE);
  AccountSchedule.RUN;


I run the code unit, but the parameters on the report is not what i pass to it (like colun layout name, datefilter, dimension filter....etc). System seem using my previous manually input parameters on report.


Do you know how to solve it?

Thanks

Comments

  • kinekine Member Posts: 12,562
    You need to look into OnPreReport etc. triggers to see, if there is some initialization of the values... of course, there can be problem with OnInit on request form etc. But this is only hint where to search, I am not sure which triggers are fired when etc. now...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.