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

BUG - "Canvas does not allow drawing"

edited March 2012 in General
Delphi 6 / RB 7.04

Hi there

I know that Im running an older version of Delphi/RB, but all is still
working well.

However, every so often (randomly) users receive the error message "Canvas
does not allow drawing" when trying to print a document. On screen the page
display fine. It is only when they click the print button from within the
Screen Preview.

We have a number of printers, and it only seems to be a Kyocera FS4020
causing the problem, which is a new printer.

Could I maybe insert some code into the ScreenPreview Print button.onclick
event, that checks for a default printer before the button is clicked. I
mention this, because I have read that sometimes this is a bug in RB trying
to print to a printer, when no printers exists etc? I could put code in the
onclick event to check for a Default printer.

Not sure if this helps, (or makes a difference) but the environment is Win
XP SP 3 clients and a SBS 2003 Server. The Kyocera printer is a shared
printer from the server. Using GPO, when a user logs onto the client PC,
printers are deleted and then re-added depending on which PC has been logged
on.


Any thoughts

Lee Parvin

Comments

  • edited March 2012

    ReportBuilder caches the list of available printers, if you printers being
    add/removed, then you try calling.

    uses
    ppPrintr;

    ppPrinters.Refresh;

    If you get this error on a specific printer, then I recommend updating the
    printer driver.

    You can also try checking to make your application does not have
    memory/resource leaks. A tool such as FastMM configured in debug mode can be
    used to do this.



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

    Best regards,

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

    I have updated the printer drivers, and ran the Delphi code in Eurakalog,
    which does not report any problems.

    However, today some of our users reported :-

    "Screen printer does not support printing" and
    "Canvas does not allow drawing"

    These errors occur as the Delphi code tries to display the screen preview ie

    Report1.DeviceType := 'Screen';
    Report1.PrinterSetup.PrinterName := 'Default'
    Report1.Print;

    The printer is question is a Kyocera FS4020DN.

    Before calling the Report.Print code, could i use some error checking code?
    eg if (Report1.PrinterExits) then Report1.Print;

    Do you have any thoughts?

    Many thanks

    Lee





  • edited March 2012
    RB 12.-05 was the last produced release for Delphi 6. I recommend
    downloading a trial of RB 12.05 and then perform the same test. The
    ReportBuilder architecture has evolved quite a long way since RB 7.x.

    I also recommend trying to recreate the error on your machine. Download and
    install the printer driver to your machine and configure it to be the
    default printer (you can do this without having the printer hardware). Ask
    the user for specific steps to recreate the issue, and then perform those
    steps.

    Both of those errors indicate ReportBuilder could not get valid printer
    device context (i..e. printer canvas handle). You can try checking
    Report.Printer.DC = 0, that would indicate an issue, the value should be
    non-zero.

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2012
    Hi there

    Im going to buy an upgrade. Im currently on 7.04 Pro.

    Wich one of the selections in the Order Product list do I use???? Is it
    Upgrade Professional $399. Will this give me 12.05???

    Cheers

    Lee



  • edited March 2012

    Yes, purchasing an upgrade to ReportBuilder 14 also includes the ability to
    download the last produced release for Delphi 6, which is ReportBuilder
    12.05. I recommend contacting sales@ if you have additional questions about
    ordering or downloading.


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

    Best regards,

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