Home General

Preview

edited August 2001 in General
Delphi 3.0
Report Builder 4.23

Hello,
I have a problem about preview the pages. It always give me a one
more blank page at the end. Like I have 10 pages, then it will give me
11 pages, the 11th is a blank. If I have 4 pages, it will give me 5
pages, the 5th is a blank. How can I handle this?

regards,
Meixi

Comments

  • edited August 2001
    Describe the layout of the report. Is this only on one printer? What about
    in the preview?
    There was a known bug in the old versions of RB 4.x where a subreport in a
    group footer, or something invovling subreports, could cause an extra page
    to be printed. If I knew the layout or what is causing the problem, then
    maybe I can send you a patch from our archives. Take the report, and start
    removing/modifying components until the problem goes away, then you'll know
    which configuration or component is causing the problem.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim:
    Thanks to reply.
    Actually this happened at preview time. When I clicked the preview button,
    everything on the report was correct, except that there was one more blank page.
    Which one controls the page count( like TppPublisher, TppPage,Tlist...)?
    I have 12 possible pages for the report. But some times there are only
    (5,6,7,8) of them there. as long as the last two pages are there(11,12 --one for
    front, one for back), the preview is correct. If the report doesn't have the
    last two pages( the database doesn't have those two records), the blank page
    will appear.

    regards,
    Meixi

  • edited August 2001
    The report engine generates the pages. You can control which pages are sent
    to the printer by taking a look at demo #124.

    You can either print individual pages or print a range of pages with this
    method:

    ppTextToPageList('1,30', Report.PrinterDevice.PageList, True);
    ppTextToPageList('1-30', Report.PrinterDevice.PageList, True);


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Hello, Jim:
    Thanks to reply.
    My problem was that report engine generates one more page (which was blank),
    when I don't have the last page (page 12th). I can miss any one except the last
    one. (There are 12 subreports in my report, each one has own data pipeline.)
    How can I handle this?

    Regards,
    Meixi

  • edited August 2001
    So, you are filtering the data, and sometimes you have 5,6,7 or 8 correct
    pages total. But if the report is an 11 page report, there is an extra
    blank page generated. Is this correct? This certainly sounds like some sort
    of bug in RB. I'm looking at all of our patches and I don't see any
    relevant ones available for your version. Our current version only supports
    Delphi 4,5, and 6.

    One thing I can think of, is to use the OnEndPage event of the report. This
    will give you access to the current page object being generated
    (Report.Engine.Page). You can get the draw command count to see if it is a
    blank page (Page.DrawCommandCount). Then you might be able to set the
    pagelist to print a range of pages which is one less than the total page
    count, as described in my previous post.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Thanks, Jim!
    My boss said we'll upgrade to Delphi 5. Hope the problem can be solved after
    that.

    Regards,
    Meixi

  • edited August 2001
    We're confident that upgrading will fix the problem. If for any reason
    there is a bug in RB, by upgrading you'll be able to take advantage of our
    support with new patches and maintenance releases. I do believe there is a
    cost from upgrading from a D3 version of RB to RB 6. Contact
    info@digital-metaphors.com for upgrade pricing. Thanks!


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Thanks! We'll upgrade soon.

    Regards,
    Meixi



  • edited September 2001
    Hello, Jim:
    We upgraded to Delphi 5 and ReportBuilder 6 already. But I still have the
    same problem.
    If the report doesn't have the last page( the database record for the
    last page is empty), the one blank page will appear.

    regards,
    Meixi

  • edited September 2001
    So, you have a subreport which generates the last blank page when no data
    exists for it in its pipeline. Go into the designer workspace for that
    subreport and click on the greyed out icon in the top left corner of the
    rulers for the workspace. This should cause the child report object to be
    shown in the object inspector. This will give you access to the
    NoDatabehaviors property of the subreport. Set the NoDatabehaviors to
    ndBlankPage, which will cause no pages to be generated whne no data exists
    for this subreport.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    Hello, Jim:
    I went to check the NoDatabehaviors property of that subreport. It already
    set to
    ndBlankPage. The NoDatabehaviors property of ppReport have been set to same
    way too. It doesn't work.
    Let me explain little bit more.
    In my project, there are several pairs (7&8, 9&10) which are front and
    back page. If there have 2 of page 7 and 2 of page 8, I need make sure the
    order: first 7 and first 8 , second 7 and second 8. I used the code that you
    gave to me earlier, so this problem already have been solved well. But inside
    those code, there are controls: PrintToCache; ReorderPages; ... . I don't
    know those code caused blank page or not.

    Regards,
    Meixi

  • edited September 2001
    Hello, Jim:
    I just checked, doesn't matter you have the pair page or not (that means
    the code you gave to me earlier doesn't cause the blank page). I tried put three
    subreports there, and if I make the datebase record of last one is empty, the
    blank page will be given.

    Regards,
    Meixi

  • edited September 2001
    Can you send me an example of this report to support@digital-metaphors.com


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    I downloaded your demo and ran it. I had to delete the demo from the
    newsgroup since it was a large attachment. The subreport prints a blank
    page when no data exists in the datapipeline. In the DetailBand.BeforePrint
    event, you will need to set the visibility of the subreport so that it won't
    generate a page.

    uses
    ppTypes;

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin

    if (ppdaNoRecords in plNOrd.State) then
    ppSubreport3.Visible := False;

    end;

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    Hi, Jim:
    It works great! Thank you very much!

    Regards,
    Meixi


This discussion has been closed.