Modify DatePicker via Macro

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Modify DatePicker via Macro

    Hi,

    my report contains two datepicker elements. The report then shows items between date1 and date2.
    The problem now is that assign some default date like date1: =TODAY()-60 and date2: =TODAY().
    The datepicker is used as variable @date1 and @date2

    Now the report is opened and @date1 and @date2 can have different values (depends from the last selection and the last saving of the sheet) than datepicker date1 and date2.

    The consequence is that the report shows no result. I first have to select a (different from the selected) value in datepicker date1 and then also in datepicker date2 and then the report works fine.

    I tried to assign default date fro @date1 and @date2 via __open() macro but that has no effect on the selected date of the datepicker.

    Can anybody help me how to avoid this problem?
  • hi,

    you should use the following command:

    define_variable('date1',<ts>);

    where <ts> is the serial number of your date (ie the number of days between the wished date and the 01.01.1900)

    for instance this:

    define_variable('date',42448);

    will set the datepicker to 03/19/2016

    hope this helps!
    laloune

    Post hoc, non est propter hoc