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

ShowPrintDialogue does not reflect the printer settings when changing from the default

When using the ShowPrintDialogue RB21.4 and change the default printer and clicking on the properties, the preferences for that printer has the 'Print on both sides:' shows 'no' when it is actually set through Windows setup. The 'Print Setup' within Delphi 10.4 shows this correctly.
Another thing I've noticed is when I select one printer and change this preference and then select another printer this setting is still set even though I know this printer is set dfiffently - this is within the same PrintDialogue.
The behaviour is the same in your SavePrinterDevMode example.

Comments

  • Hi Steve,

    In general Report.PrinterSetup properties determine the printer settings shown in the Print Dialog. For PrinterSetup.Duplex there is a dpDefault setting which will use the Windows Printer's setting.

    The Report.PrinterSetup properties are saved as part of the report definition.

    For RB 21.05 there are no code changes to this.

    I'm not clear on what you are describing.

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • I know that the Report.PrinterSetup is saved as part of the report definition, this is not the issue.

    It is when a user is presented with the Print Setup dialogue which shows the windows default printer and proceeds to change this to a network printer which has duplex defaulted to on and when printed results in single pages. When selecting the network printer and clicking on properties the 'Duplex' is set to 'NO' so changing the printer hasn't refreshed the selected properties - I would expect this to be done and override the Report.PrinterSetup details.
  • image

    Image on the far right is the 'Control Panel' Printer Preferences, the other is running your SavePrinterDevMode and selecting a different printer from default resulting in the properties not matching where I would expect it should.
  • Is looks like DM_IN_BUFFER is being passed into ppDocumentProperties in ShowPropertiesDialogue which is causing the issue according to Microsoft documentation which copies the current properties into DEVMODE.

    So do I need to override this function to remove this? As I cannot find an alternative solution, unless you are going to add this as an option to switch off?
  • Hi Steve,

    Try a simple test. Create a new Delphi project, add a Report and Button to the form. In the Button.OnClick call ppReport1.Print. Preview form is displayed. Press Print button, the default printer is selected. Press Properties button - the dialog will show Duplex option configured for the printer in the Windows Printer Panel. Press Cancel to close the Properties dialog. Now select a different printer, press Properties button - the dialog will show Duplex option configured for that printer in the Windows Printer Panel.

    However, if you press Properties button to display the dialog and then press OK (rather than Cancel), then Report.PrinterSetup properties are updated.



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • What is happening is that the user is changing from the default printer to another which has duplex on by default, pressing OK and the report is NOT being printed on both sides. So it is not updating the properties correctly.

    Any other program for example Notepad does show the correct preferences when changing between printers.
  • Hi Steve,

    Please try the simple test detailed above - follow the steps precisely.


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard

    I have created a new project as instructed and found that first time changing to the printer with duplex set shows correctly when in the properties - pressing the 'OK' button and changing to another printer that doesn't have duplex set has the duplex set in the properties.

    This also happens the other way round, when first selcting the non duplex printer and clicking 'OK' in properties and then selecting the duplex printer then the properties is wrong for that printer.

    Regards
    Steve
  • Hi Nard

    Have you got anything for me? I had a look at 21.05 for changes, but not had time to install.

    Regards
    Steve
  • Hi Steve,

    Based upon your feedback, this feature is being enhanced for RB 22.

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard

    Have you a date when RB 22 will be released?

    Regards
    Steve
Sign In or Register to comment.