Problem using Date table in a report with DataItemTableView

imurphyimurphy Member Posts: 308
I want to run a report showing the balance of a GL Account for each day in the last 7 days.

My initial reaction was to make use of the Date table and filter it in the designer for the last 7 days. So, I tried filtering on 'Day'. My problem comes with the Period start/end fields

If in properties I add a filter to the DataItemTableView property with a syntax of
CalcDate('<-D7>', Today)
it complains. I've tried dozens of different combinations but cannot get filtering on the Period columns to work at all. I simply cannot get the parameters to the CalcDate function correct. I may also be complicating my life here.

Any suggestions?

Ian

Comments

  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi imurphy,

    If I am getting you correctly,

    Set the filter in Date - OnPreDataItem() through code
       Date.SETRANGE("Period Start",CalcDate('<-7D>',Today));
       Date.SETRANGE("Period End",Today);
    
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • imurphyimurphy Member Posts: 308
    I've ended up doing something pretty much identical.

    My problem is that I was trying to do this via the DataItemTableView property in the properties for the Date object on the report.

    Setting 'Period Start' - Filter - CalcDate('<-7D>', Today) in the filter list always resulted in a date error. The same expression in code was fine - which didn't make much sense.

    I could enter a fixed date without any problems, just not a calculated date.

    Ian
Sign In or Register to comment.