Skipping records in recordset in the onFormat event...

Originally Posted 1 February 2012, 10:43 pm EST

  • Originally Posted 1 February 2012, 10:43 pm EST

    VSView 7.0

    I create a recordset in my VB code.

    I set 'VSR.DataSource.RecordSet = rs'.

    I then do a VSR.Render VSP.

    In the OnFormat event, I want to test the current record, and if it doesn't meet certain criteria, I do a .MoveNext on the recordset and test again.

    This all works fine and the report does skip the records I don't want included in the report.

    However, if in the OnFormat event, my .MoveNext produces an EOF situation (wherein I Exit the OnFormat event and also test in the OnPrint event as well and exit) in the recordset, VSR.Render throws a "No current record" error at the end of the report. If I ignore that error, I get an empty report row at the end.

    What is the proper way to skip records in recordset to only have those records you want output?

    Thanks
    Jeff
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels