Printing report shows xrec data?

DHendriksenDHendriksen Member Posts: 32
Hi all,

I do have a basic problem I guess, but I don't know the answer to solve it. The fact is:
Our customer set the field Blocked to yes while changing the item card. After the card is changed the Item will be unblocked, so it can be used. While unblocking there shoul be printed a report with several fields. But guess, all the data which is printed is the xrec data. Why?

I've tried the following:
- In the Onvalidate of the field Blocked we added the code:
Report.RUN(reportno, false, false, rec); Doesn't work
also the Report.RUNMODAL(reportno, false, false, rec); Doesn't work
- I replaced the Rec by a local variable lRecItem. Doesn't work
- Even a commit doesn't work! That's strange.
- Moving the code to the OnModify of the table. Doesn't work.

What will work is the following:
Report.RUN(reportno, true, false, rec);
So the request form will be shown to the user. Then the current data is presented. Why? The report should be printed automatically.

This customer uses Dynamics NAV 4.03 engine on SQL.

Please help, thanx in advance!

Don Hendriksen

Comments

  • kinekine Member Posts: 12,562
    During OnValidate the record is not saved into the database yet. The report is taking only filters from the passed record, not the values. If you want to pass the values, you need to create some function in the report and call this function. Than you need to use the passed values in the report. Because that you need to call the report through variable of type report.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DHendriksenDHendriksen Member Posts: 32
    Kamil,

    Thanx for your answer.

    What you suggested works fine. On the report I created a global functions to pass the current Item record. And used this record data to present on the report. Basically the report was based on the Item table, I changed it to the Integer table with numberfilter = 1.

    We solved the problem.

    Thanx!
Sign In or Register to comment.