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

Re-generate report after changing printers

edited February 2002 in General
Hi,

I have a report that is printing images (actuals maps), so I have this
report getting the printer page sizes, then making my border, image etc
to fit the page.
If on preview, the user changes printers (printer setup dialog called -
ppPrinter), how do I get the report to re-generate and where would I put
the code to set all the sizes to match the paper.


Thanks
Alan.

Comments

  • edited February 2002
    This is a bug. I'll send you a patch if you send your email address (Attn:
    Jim) with a request to support@digital-metaphors.com. The report should
    automatically regenerate when you change printers.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    I also have a report that adjusts layout to the page size etc. before
    printing. I use a custom page setup dialog to gather margin values etc. and
    apply these to the report in BeforePrint.

    If this page setup dialog was available from the preview form (already
    custom), allowing the user to modify the page layout, then how do I get the
    report to re-generate and apply these changes and show them on the preview?

    Jim, I think I also need the patch so the report automatically regenerates
    when you change printers from the printer dialog, but how do I bring the
    other page changes in as well?

    Thanks
    Sarah
  • edited February 2002
    Why don't you put the patches on your announcements group so that we can all
    get it if we want it?

  • edited February 2002
    I've emailed you three the patch file. Place it in your RBuilder\Source
    directory and recompile using this path instead of RBuilder\Lib.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Our current policy is to not publicize every little bug that has been fixed,
    sorry. True, there are a few patches which could affect many users.
    However, most patches are specific to a very small customer base, usually
    only one customer has the problem. I understand that you would like to check
    the bug list for a patch before spending hours researching why a report
    won't work. Perhaps, in the future we can make a webpage listing where you
    can review them and download patches.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    "Sarah Ashton" wrote in
  • edited February 2002
    Recompile what? There are several bpl files. I understand that one is to
    uninstall one of them, and recompile the dpk file. Which one?

  • edited February 2002
    This is a run time fix until we get a maintenance release out with rebuilt
    packages. Just change your library path to point to your local copy of our
    source in RBuilder\Source, so you can use the new .pas file when you compile
    your application, like you normally would from the RBuilder\Lib's dcu's.
    You do not have to rebuild the RBuilder packages.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Thanks!

  • edited February 2002
    Thanks for the patch Jim.

    Sorry I confused myself considering some TppPrinterSetup fields separately
    from others. I use separate dialogs to set/store them, and then apply to the
    reports within their BeforePrint. This is a legacy from my pre-RB days,
    applied with brute force and ignorance :)

    Since I want to have an application wide (default) PrinterSetup, set outside
    the reports and applied to all of them, how would you suggest doing this? Is
    it a matter of having an application global TppPrinterSetup, using this to
    store the values from the dialog and then setting each report.PrinterSetup
    to this global, or is there already a global PrinterSetup that I can use?

    Sarah
  • edited February 2002
    There are only singleton objects for the printer and the printer list. The
    PrinterSetup is only an object embedded in the report object. If you have
    one report component, and are loading templates into it, then you can set
    Report.SavePrinterSetup to true and your one Report object should always
    have the current printer setup in it. It sounds as if you have a report in
    each form and aren't using tempaltes for all reports, so you'll have to
    create a singleton PrinterSetup object so that it is always configured with
    the latest printer setup as the app runs and reports are printed.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    No, I am not using templates (yet?) as there is no need to separate the
    report definition from the executable, no user modification etc. Instead I
    have a couple of reports, but each with a large number of subreports
    covering a variey of information. But I do not create the reports (or form
    they are on) until they are needed, and free immediately after printing
    (conserving those 64K limited Windows resources). So generally I do not have
    a report component to hold the PrinterSetup.

    Maybe I am doing things an odd way around? But I think I see how to use a
    TppPrinter to manage the default PrinterSetup.
    Thanks

    Sarah


  • edited March 2002
    There's nothing stopping you from creating a singleton TppPrinterSetup
    object yourself and using it in your application to configure the different
    Report objects' PrinterSetup properties when they are instantiated.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.