Recent

Author Topic: LazReport Error: unsupported FRF format  (Read 21842 times)

99Percent

  • Full Member
  • ***
  • Posts: 160
LazReport Error: unsupported FRF format
« on: October 14, 2010, 01:09:22 am »
In case you are getting this error this is how I solved it.

First do not use the StoreInDFM property, it appears to not be supported yet.

Store the report file in a resource file and add the resource file to the unit. Then load the file like this
Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
var
  ReportSL : TStringStream;
begin
  ReportSL:=TStringStream.Create(LazarusResources.Find('codigos').Value);
  try
    frReport1.LoadFromXMLStream(ReportSL);
  finally
    ReportSL.Free;
  end;
  frReport1.PrepareReport;
  frReport1.ShowReport;
end;

initialization
  {$I 'codigos.lrs}

end.

I added the include resource statement to the example. The important difference is to use LoadFromXMLStream, instead of the more intuitive LoadFromStream, because LoadFromXMLStream seems to initialize some critically needed internal variables of the report object.

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: LazReport Error: unsupported FRF format
« Reply #1 on: October 19, 2010, 07:14:18 pm »
Quote
it appears to not be supported yet.
Are you sure?

Anyway thanks for the info, glad to read this :D

cokocool

  • Newbie
  • Posts: 3
Re: LazReport Error: unsupported FRF format
« Reply #2 on: May 09, 2012, 10:26:21 pm »
hola, es un problema con la impresora, cambia a otra predeterminada, cierre y abre nuvamente tu proyecto.

 

TinyPortal © 2005-2018