RecRef on 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

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    OnPreReport is executed before even a single record of your DataItem is touched. You have to move your code to another trigger, e.g. OnAfterGetRecord of your DataItem, or something like that.

    If you do so, you don't need a loop anymore. Your DataItem will be looped anyway.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • archer89archer89 Member Posts: 337
    set your custom table 50000 (employee ?) as first dataitem in your report,
    add needed fields as columns under that dataitem.
    set needed report layout to display the values.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • krikikriki Member, Moderator Posts: 9,115
    [Topic closed because of double posting]
    See https://forum.mibuso.com/discussion/69464
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


This discussion has been closed.