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

Problem with paper size in 6.02...

edited October 2001 in General
When printing a report, I look at the paper size selected by the user in the
print dialog and rescale the report so it fits the page as well as possible.
This all works fine and the report prints correctly. The problem that I now
encounter is, when the page size is increased (i.e. from A4 to A3) all
componends grow as expected, but the paper on screen stays the same, causing
the controls to overflow onto the grey background. This worked perfectly in
5.52 at the time (meaning the background paper on screen got resized to the
size specified by ppReport.PrinterSetup.PaperName).

Do I have to set something else in order to get the page resized or is this
a bug?

Cheers, Marco...
-------------------------------------------------------------------
Marco Heine
QUMAS
Enterprise Compliance Management
Visit our Website: www.qumas.com

Comments

  • edited October 2001
    You may be able to get away with setting the PrinterSetup object of the
    individual page objects, rather than the PrinterSetup object of the report.

    Otherwise, you'll need to regenerate the report. Set the Report.DeviceType
    to screen and call PrintToDevices. This will cause the PrinterSetup object
    of the report affect the generated pages on the screen and the white page
    should reflect the new paper size.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited October 2001
    I think I am having similar problems. I am trying to set the paper size and
    margins for a report dynamically before the report is generated (in the
    parent form OnCreate event). The margin settings work fine, but the paper
    size show in the previewer does not change.

    But since I am doing this before the report is generated I don't see why
    regeneration would help, and is PrintoToDevices essential as I want to print
    to the default previewer?

    What is the best strategy for building reports with dynamic layouts
    including the paper size?

    Sarah
  • edited October 2001
    > ...What is the best strategy for building reports with dynamic layouts

    OK, have moved the dynamic layout changes from the OnCreate event of the
    parent form to the report's BeforePrint event. This now seems to work
    correctly, so I guess that this is the best place to put such things :)

    Sarah
  • edited October 2001
    Hi Jim...

    since this wasn't a big issue, it too me some time to tackle this again.
    Anyway, I tried both methods, but neither worked. The page in the back stays
    the same, even after a PrintToDevices. Any other idea?

    Cheers, Marco...
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com

  • edited October 2001
    Perhaps the problem is where you are dynamcally sizing things? That was my
    problem: orginally I tried adjusting the control and paper sizes in the
    FormCreate of the parent form, and the paper size changes were ignored. Once
    I moved all the rescaling to the Report OnBeforePrint event every thing was
    fine.

    Sarah


    in
    I
    perfectly
    to
  • edited October 2001
    Hi Sarah...

    Unfortunatly that is not it. I do the rescaling on the "OnBeforePrint" event
    already. Everything works fine in the sense that the report prints
    correctly. Only on-screen its messed up. Right now I worked around it by
    re-generating the report after priting (which is a bit of a pain in the
    butt). As I said, it worked perfectly with RP 5.56. Any other ideas =)

    Cheers, Marco...
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com
  • edited October 2001
    Have to say that it "works for me" :)
    Could you create a simple demo application that shows the problem?

    Sarah
This discussion has been closed.