RecRef in Report

NAV1991NAV1991 Member Posts: 4
Hi,
I use RecRef type to show date on report (navision 2016). The code is:

OnPreReport()
RecRefe.OPEN(50000);
FieldRef:=RecRefe.FIELD(4);
IF RecRefe.FINDFIRST THEN
REPEAT
EmployeeNo:=FieldRef.VALUE;
UNTIL RecRefeR.NEXT=0;

When I show EmployeeNo on report I only get the last value, but I need list of all employees. How to solve this?

Best regards

Best Answer

Answers

  • vaprogvaprog Member Posts: 1,116
    edited 2017-06-23
    Hi,

    Add code in your REPEAT loop to do, what you need.

    Or maybe you need a proper DataItem?
  • NAV1991NAV1991 Member Posts: 4
    The code is already in REPEAT loop. I do not have access to table (50000) and can not use DataItem.
  • NavNabNavNab Member Posts: 181
    Answer ✓
    Hi NAV1991,

    Check the report (delete .jpg and import the report in your database. Report ID = 92600).
  • da_nealda_neal Member Posts: 76
    Use Table Integer for DataItem.
  • vaprogvaprog Member Posts: 1,116
    NAV1991 wrote: »
    The code is already in REPEAT loop.
    Yes, I can see that there is a REPEAT loop. I did not tell you to add a REPEAT loop, but I did tell you, you should add code in the REPEAT loop, becaus what you did was repeatedly overwrite the EmployeeNo without actually using any of them (except probably the last one, outside the code you showed us).
    NAV1991 wrote: »
    I do not have access to table (50000) and can not use DataItem.
    Your access to table objects or table data does noch change with using RecordRef. Rather than using an Integer DataItem, as nabil.bamoh@hotmail.com suggested, you can create the Dataitem for the table 50000 directly, if you have rights to read that data. If you cannot read that data, you can't test your report, and should not have to create it in the first place. This is not only much easier to do, but also much easier to understand and maintain later.
  • krikikriki Member, Moderator Posts: 9,094
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.