Date, Report & SETFILTER

dulamandulaman Member Posts: 73
Hello!

I want to set a filter in a report that has two DataItems: Date & OtherTable.

In order to get a report that displays the resources used in a certain day, I try to set a double filter like this:
recOtherTbl.SETFILTER("Starting Date", %1, myDay);
recrecOtherTbl.SETFILTER("Ending Date", %1, myDay);

(myDay is a user variable from the Request Form).

NAV always returns the error: myDay is not a valid date. But of course myDay IS a valid date! I cannot understand what is wrong in my syntax. ](*,)

In the other hand, the Date DataItem must be ran only once, but I am wondering how.

I'd thank your kind suggestions very much! [-o<
-- dulaman
"I don't want to believe. I want to know." (Carl Sagan)

Comments

  • ara3nara3n Member Posts: 9,257
    It's hard to understand what you are trying to do or how your report is structured, Could you export it to text and put in here?

    Also
    recOtherTbl.SETFILTER("Starting Date", %1, myDay);
    

    should be
    recOtherTbl.SETFILTER("Starting Date", '%1', myDay);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • dulamandulaman Member Posts: 73
    Oops! :oops:

    Thank you very Much, Rashed! I'm sorry but I found out that I was still using a bad piece of code inside of one of the sections -- that was the problem with SETFILTER function.

    Anyway, the other problem persists. I wonder how I can run only once a DataItem section.

    My report is meant to be kinda calendar & must do the following:

    First, it asks you for a date
    Second, the header must show that date
    Third, it should display all the machines that was been used in that date. The Machine-Line table has two fields for that: Starting Date and Ending Date.

    I structured my report with two DataItems:

    Date
    Machine-Line Table(indented)

    But presently the report does the following:

    First, it asks you for a date
    Second, the header shows that date
    Third, it displays all the machine lines, used or not, in that date, and then it loops "ad infinitum".

    Thanks again, you can find the txt file at this link:

    http://www.novafantasia.com/calendar.txt
    -- dulaman
    "I don't want to believe. I want to know." (Carl Sagan)
  • sggsgg Member Posts: 109
    dulaman wrote:
    Anyway, the other problem persists. I wonder how I can run only once a DataItem section.

    You could Change the Value MaxIteration Property of each DataItem you want to run Once to 1
    Sunday, Godwin G
  • dulamandulaman Member Posts: 73
    Thank you very much, sgg!!! \:D/

    I am wondering how on heck can I call myself a Navision developer -- but I am unable to even see to the properties!! :whistle: :oops: :oops: :oops:


    Anyway, I have solved my problem and this is the final result (maybe someone else wanna use it):

    http://www.novafantasia.com/calendar.txt
    -- dulaman
    "I don't want to believe. I want to know." (Carl Sagan)
Sign In or Register to comment.