Crash on frxPrinters.FillPrinters and DesignReport

vosvos
edited 6:22PM in FastReport 4.0
If I first call frxPrinters.FillPrinters and then Report.DesignReport I get an EInvalidOperation exception with message 'Canvas does not allow drawing'.

Example:
var
  Report: TfrxReport;
begin
  Report := TfrxReport.Create(nil);
  frxPrinters.FillPrinters;
  Report.DesignReport;
end;
I'm using the latest version (4.5.57).

Comments

  • edited 6:22PM
    vos wrote: »
    If I first call frxPrinters.FillPrinters and then Report.DesignReport I get an EInvalidOperation exception with message 'Canvas does not allow drawing'.

    Example:
    var
      Report: TfrxReport;
    begin
      Report := TfrxReport.Create(nil);
      frxPrinters.FillPrinters;
      Report.DesignReport;
    end;
    
    I'm using the latest version (4.5.57).

    Hi,
    I get the error too.
    I use FastReport 4.5.13 and if I loadfromfile the report and then call the designer I get the error BUT
    if I call the designer and INSIDE the designer I open the report, its works fine
    my code :
    frxReport1.LoadFromFile(ReportFileName);
    frxReport1.DesignReport;
    

    I think it's a bug inherited from FR3.
  • edited 6:22PM
    Henry49fr wrote: »

    Hi,
    I get the error too.
    I use FastReport 4.5.13 and if I loadfromfile the report and then call the designer I get the error BUT
    if I call the designer and INSIDE the designer I open the report, its works fine
    my code :
    frxReport1.LoadFromFile(ReportFileName);
    frxReport1.DesignReport;
    

    I think it's a bug inherited from FR3.

    Hi, I have fixed the error.
    May be it's works for you [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> In the properties of the report, Instead of setting the property "printer" to "default printer", I still had an old printer setting which I no more have in the list of available printers on my computer.[/img]

Leave a Comment