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

Colour printer is set to Black and White but Report Designer prints it out in color

edited December 2006 in General
Hi,

I'm using Report Builder 9.03 with Delphi 7. When I print a
report out it prints it out in color even though the printer properties
are set to Black and White.

Other Windows applications like MS Word, print out color documents in
black and white.

If I go into the printer properties and just press Ok. it will print out
in black and white. I've been through all the printer settings numerous
times and can't see anything else that I could change.

Printer is Lanier LD124c if that's any help.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2006
    Hi Brenton,

    Where exactly are you setting the printer to print black and white? If you
    are doing so from the Properties dialog of the printer accessed from the
    Print Dialog, this is using the Windows API to make the setting for your
    printer. Note that ReportBuilder does not communicate with your printer
    directly, it uses generic Windows API commands that are received by the
    printer driver. It is the job of the printer driver to understand and
    process these commands correctly.

    My first suggestion would be to download the latest version of the printer
    driver you are using and see if that helps the problem.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    Hi Nick,

    The Printer was changed to Black and White from the Windows Control Panel.
    Other applications as noted above will print color documents in black and
    white fine but for some reason Report Builder continues to print out
    reports in color. I'll update the printer drivers now and see if this
    makes any changes

    Regards
    Brenton




    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2006
    I've updated to the latest drivers and it still continues to print out
    color reports even though the settings are black and white.

    Any suggestions would be great as its costing me a little over 100% extra
    per page at the moment.




    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2006
    Hi Brenton,

    I did a quick check and it looks like we enhanced the TppPrinter class to
    better support the DEVMODE structure values for RB 10. Try downloading a
    trial edition of RB 10.04 and test with that.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    I've got this to work but it wasn't an out-of-the-box solution. (DM may slap
    me here because I've had this for a while and it may not be needed in
    version 10).

    My app has a common print dialog for all reports. What I wanted is to have
    the default printer settings, and if the user changes them in the app, they
    stay that way during the whole run of the program.

    What I did was create two variables that are not part of an object, they are
    declared under the implementation section of the report form:

    var
    FPrinterDevMode: THandle = 0;
    FPrinter: TppPrinter = nil;

    then in the constructor of the print dialog, I check if they have been
    assigned, and if not, assign them:

    ppPrinter.SetDevMode(0);
    if (FPrinterDevMode = 0) then
    begin
    ppPrinter.GetDevMode(FPrinterDevMode);
    ppPrinter.SetDevMode(FPrinterDevMode);
    end;

    the user can edit the pritner setup in the following code:

    procedure TfrmTRAKPrint.btnSetupPrinterClick(Sender: TObject);
    begin
    if not assigned(FPrinter) then
    begin
    FPrinter := TppPrinter.Create;
    FPrinter.PrinterSetup := FppReport.PrinterSetup;
    end;

    ppPrinter.SetDevMode(FPrinterDevMode);
    if FPrinter.ShowSetupDialog then
    FPrinter.GetDevMode(FPrinterDevMode);
    end;

    And I check that the report has the printer assigned before printing:

    if assigned(FPrinter) then
    FppReport.PrinterSetup := FPrinter.PrinterSetup;
    FppReport.Printer.SetDevMode(FPrinterDevMode);

    and in the BeforePrint event, check that the printer device is set
    correctly:

    if (FppReport.Publisher.DeviceCount = 1) then
    begin
    ...
    else
    if (FppReport.Publisher.Devices[0] is TppPrinterDevice) then
    TppPRinterDevice(FppReport.Publisher.Devices[0]).Printer.SetDevMode(FPrinterDevMode);
    end;

    and in the finialization of the unit, do some clean up:

    finalization
    if (FPrinterDevMode <> 0) then
    GlobalFree(FPrinterDevMode);
    if assigned(FPrinter) then
    FreeAndNil(FPrinter);


    HTH,

    Ed Dressel
    Team DM
  • edited December 2006

    RB 10.04 includes improvements for merging the Report.PrinterSetup
    properties with the DevMode settings from the Windows Control panel.

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2006
    > RB 10.04 includes improvements for merging the Report.PrinterSetup

    :-)

    The only difference then in my code sample and app is that my TppReport
    object doesn't live the whole session, it is only created when the user
    wants to print, and I need to keep my settings as long as the app is open.

    --
    Ed Dressel
    Team DM
  • edited December 2006

    Makes sense then.

    There are really two cases here

    - I want my report to use the Printer settings (DevMode) from the Windows
    control panel (plus the Report.PrinterSetup settings)

    - I want my report to use the Printer settings chosen by the user from the
    Printer Properties dialog (plus the Report.PrinterSetup settings).



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.