Crash on frxPrinters.FillPrinters and DesignReport

vosvos
edited 3:11AM 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 3:11AM
    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 3:11AM
    Henry49fr wrote: »
    Henry49fr 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.

    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.