Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Traversing multi-page width report in Viewer

edited July 2008 in General
Hi All

In setting up a report that is 2 page widths wide,
I set up a report w/ 2 child subreports and just let
the 1st page width generate first, then the second.

Th report generally isn't long but I would like to
somehow control the tppViewer pagination
to jump to the appropriate 2nd page width.

Example:
8 pages * 2 widths = 16 page report total

paging fwd from page 1 will go to page 9, to page 2
2 to 10, etc. Paging Bwd will traverse the opposite.

I saw your spreadsheet method in code but I am using
6.03 and D5. Can I just manipulate the Viewer paging
mechanisms to do what I want?

Thank you

Bill Lawler
The Elite Group

Comments

  • edited July 2008
    I can't speak to 6.03, but in the latest version, you can drop a TppViewer
    (which I think was in 6.x, but I don't recall) on the page and have total
    control of how it views/behaves.

    Ed Dressel
    Team DM

  • edited July 2008
    Ed:

    I placed a Viewer on the form and assigned the report to it.
    How do I control the pagination now. I tried using to GotoPage
    method od the viewer like this...

    if ppReport5.PageNo > (ppReport5.PageCount div 2) then
    ppViewer1.GotoPage((ppReport5.PageCount div 2)-1)
    else
    ppViewer1.GotoPage((ppReport5.PageCount div 2) + ppReport5.PageNo);

    But I get no movement other than +1/-1 paging (the default behaviour)

    Can you provide any ideas?

    Thank you

    Bill

  • edited July 2008
    It looks like at this point it is all you have... my old code is similar:

    if lViewer.ArchivePageNo < lTargetPageNu then
    begin
    while (lViewer.ArchivePageNo < lViewer.ArchivePageCount) and
    (lViewer.ArchivePageNo < lTargetPageNu) do
    begin
    lPageNumber := lViewer.ArchivePageNo;
    ppViewer.NextPage;
    if lPageNumber = lViewer.ArchivePageNo then
    break;
    end;

    end
    else
    if lViewer.ArchivePageNo > lTargetPageNu then
    begin
    while (lViewer.ArchivePageNo > 1) and
    (lViewer.ArchivePageNo > lTargetPageNu) do
    begin
    lPageNumber := lViewer.ArchivePageNo;
    ppViewer.PriorPage;
    if lPageNumber = lViewer.ArchivePageNo then
    break;
    end;
    end;
    end;

    Ed Dressel
    Team DM

  • edited July 2008
    okay, my code was from an archive viewer, but I believe the principle
    remains the same--witha few changes ;-)

    HTH,
    Ed Dressel
    Team DM
This discussion has been closed.