Help in a report

AnonymousAnonymous Guest Posts: 137
Hope you can help, this may be very easy to resolve.

I have written a simple report which when run I would like it to run with the current workdate automatically, but I cannot work out how to do it.

Manually is fine as i put the date in myself, but we are going to run this on a scheduler.

MTIA

Dan

Comments

  • Lec11Lec11 Member Posts: 91
    You can put one line in the OnInitReport trigger:

    MyDate := WORKDATE;
  • garakgarak Member Posts: 3,263
    if the report is based on a DataItem with is a data table, like Item Ledger Entry, you can run the report with a filtered record like this:

    ItemLedgEntry.setrange("Date Filter",workdate);
    Report.run(YourReportIDOrname,turOrFalse,trueOrFalse,ItemLedgEntry);

    if your report doesn't work on a data table DataItem and use DataItem "Integer" you can set your Workdate on Req.Option Form (so that the user can change this, if needed) or you use the OnInitReport Trigger with following:

    YourDateVariable := Workdate;
    or
    YourRecordVariable.setrange(YourDateFieldTofilter,Workdate);

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.