Options

Why integer report skips first record

Helo,

I'm not a developer but an administrator, so i hope this isn't a totaly dumb question :)

I made a report with 2 Integer data items. In the first dataitem i filled a temporary table with data. With the second line i wanted to print out that temporary table.
In OnPreDataItem i added a range, so it wouldn't loop indefinitely (SETRANGE(Number,1,tDim.COUNT)).
In Sections-Body, OnPostSection i added tdim.NEXT so it would print next record.

It all works fine it just doesn't print out the first record of my temporary table and repeats the last record.

If anyone has an idea why this works the way it does I would really appreciate the help.

Johnny

Best Answer

Answers

  • Options
    johnnypjohnnyp Member Posts: 14
    Thank you, i found just what i needed in that report.
  • Options
    krikikriki Member, Moderator Posts: 9,096
    Because in the first loop you didn't have a record. Only after the loop finishes, you do a NEXT.

    The sections should ONLY be used for deciding or not to show a section.

    All other code should be in the OnAfterRecord-trigger:

    IF Number = 1 THEN
    tdim.FINDFIRST
    else
    tdim.NEXT;

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


Sign In or Register to comment.