Automatic paging through a large result set

(2 posts) (2 voices)
  1. sbfowler23, Member

    Hi,

    I am looking for a way of of paging through a large result set automatically. I want my reports to be displayed on a screen in our warehouse to show upcoming contracts, with no user interaction. So if the result set is longer than can be displayed I would like it to cycle through the pages. I am currently using a long winded way of achieving this by using a second table and the 'dbr.refresh' command, writing the number of rows displayed to the second table and then offsetting the table by this many rows on the next refresh and updating the second table every time. However, I don't think this is going to work with multiple screens showing the same report as they will both be attempting to write to the same table.

    Is there a way of doing this within the report code and not relying on a second table? I have played around with the 'dbr.pager' function, and while this is a simpler way of splitting the report in to pages, I can't seem to find a way of automating it.

    Any help or theories would be appreciated.

  2. myDBR Team, Key Master

    What you can do is to pass the offset as a parameter to the report and then use a linked report with new offset. To refresh the page, use JavaScript to click the button with setTimeout. No second table needed and you can have as many screens running as you like.


    create procedure sp_DBR_contracts( in_offset int )
    begin -- Check to see if in_offset needs to start from beginning select ....
    from contracts
    limit in_offset, 100; select 'dbr.button', '', 'offset invisible';
    select 'dbr.report', 'sp_DBR_contracts', 'in_offset=offset'; select in_offset+100 as offset; -- Click the refresh button with offset-class after 20 sec
    select 'dbr.javascript', 'setTimeout(function() { $(".offset")[0].click(); }, 20000);'; end

    --
    myDBR Team


Reply

You must log in to post.