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

Settings printer

edited October 2002 in Devices
Hello,

I hava some problems with the settings of the printer. As long as I use the
default printer, all the settings which are made in the printersettings are
used. If I choose another printer in the list of the available printers in
the setup-dialogbox, the settings of the printer made in the printersettings
are not used.

Comments

  • edited October 2002
    Are you using RB 7? Do you mean the printer setup on the report object or
    the printer settings specific to the printer that is selected in the printer
    properties dialog? RB will use the printer setup that is specified on the
    report object, when you print to any printer. Any changes you make in the
    printer properties dialog will not be used when you switch to a different
    printer, as it is specific to a printer. The Report.PrinterSetup should be
    applied to any printer in which you wish to print the report to.

    You cannot set the printer setup on a report after a report has generated
    pages- it will not have any effect. The pritner setup has already been
    transferred to the page object after the page has started generating in the
    report engine. You have to modify the printer setup on the current page
    object in the Report.OnStartPage event by referencing
    Report.Engine.Page.PrinterSetup.

    You can set Report.SavePrinterSetup if you want to save the printer setup
    from the dialog to the next time you print while the report object doesn't
    change. You can also save the dev mode structure as shown in this demo:

    http://www.digital-metaphors.com/tips/SavePrinterDevMode.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Hello,
    I've got another issue. I'm using Delphi 5 and RB 7.
    If I set Report.SavePrinterSetup to true and
    than select NOT DEFAULT printer from the list of the available printers in
    the setup-dialogbox. Report is printing, but an application is going down.
    (Everything is OK for a default printer)
    I didn't have that problem in RB 6. I'm pretty sure it's a RB 7 bug (maybe
    only for Delphi 5).
    If I set Report.SavePrinterSetup to false everything is working fine.
    I've tried to test it on the SavePrinterDevMode application and got the same
    issue.

    Tim.


  • edited October 2002
    It works in our tests here. What do you mean that the application goes down?
    Do you get an AV, and exception, or does it freeze? Can you reproduce the
    problem with one of our demos report projects? If so, then that will
    eliminate your code. What are the steps that you took to reproduce the
    problem- I tried different combinations but it worked on my non-default
    printer each time.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    Hi Jim,

    I've got the same problem as described by Tim.
    In my case I've got a very simple application which uses a TppViewer
    component. When a button is pressed, just the print-method of the TppViewer
    is called.
    The ShowPrintDialog-property and the SavePrinterSetup-property of the report
    are set to 'True'. The reports are displayed in the viewer correctly. When
    printing everything works fine as long as nothing is changed in the printer
    setup dialog. But when changing the printer from the default printer to any
    other printer an error occurs. The printout is ok, but after printing I get
    either an AV or the application just 'hangs'.
    When changing the SavePrinterSetup-property of the report to 'False'
    everything works as expected. I'm also working with D5 and RB7Enterprise and
    I didn't encounter this problem with RB6.03. So it seems it is absolutely
    the same issue than mentioned by Tim.

    Best regards
    Ulrich Juergens

  • edited December 2002
    Send and email to support@digital-metaphors.com We'll reply with a couple
    of patches which you can add to your RBuilder\Source directory and rebuild
    to test with.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.