Problem coverting quick report to FR

edited 4:10PM in FastReport 4.0
Hi,

I try to convert my quick report files to FR
I used this code found in the faq:
conv := TConverterQr2Fr.Create;
conv.Source := fmPrintCommande.QrCommande;
conv.Target := FReport;
conv.Convert;
FReport.SaveToFile('c:\report\commande.fr3');

i got message :
target not assigned

Could someone have an idea ?

Thanks



Comments

  • gpigpi
    edited 4:10PM
    Can you show all your code?
    What class of FReport - TfrxReport?
  • edited 4:10PM
    Good morning,

    I haven't all the code here it is at home i'll post it in the evening.
    But the code i posted it's all i have done.
    Except that i declared FReport as :
    Var
    FReport : TfrxReport;
    Begin
    conv := TConverterQr2Fr.Create;
    conv.Source := fmPrintCommande.QrCommande;
    conv.Target := FReport;
    conv.Convert;
    FReport.SaveToFile('c:\report\commande.fr3');
    End;
    

    Thanks
  • gpigpi
    edited 4:10PM
    Try
    Var
    FReport : TfrxReport;
    Begin
    conv := TConverterQr2Fr.Create;
    FReport := TfrxReport.Create(nil);
    conv.Source := fmPrintCommande.QrCommande;
    conv.Target := FReport;
    conv.Convert;
    FReport.SaveToFile('c:\report\commande.fr3');
    FReport.Free;
    conv.Free;
    End;
    
  • edited 4:10PM
    Hi,

    I tried your code but i got this message :
    raised exception class EFCreateError with message
    cannot create file 'c:\report\commande.fr3'
    

    Also in the first time , i added, for the conv variable in the declaration section :
    Var
    FReport:TfrxReport;
    conv : TConverterQr2Fr;
    


    because i had error when compiling :

    Undeclared identifier conv

    Thanks
  • edited 4:10PM
    Sorry, it work fine.... just the path was incorrect

    Thanks very much gpi

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.