Problem coverting quick report to FR

edited 4:19AM 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:19AM
    Can you show all your code?
    What class of FReport - TfrxReport?
  • edited 4:19AM
    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:19AM
    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:19AM
    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:19AM
    Sorry, it work fine.... just the path was incorrect

    Thanks very much gpi

Leave a Comment