PDF Exporting a Composite Report results in an AV

edited November 2009 in FastReport 4.0
i've built a composite report aproximately like this.
frxReport.LoadFromFile(ExtractFilePath(Application.ExeName) + REPORT_DIRECTORY + 'report1.fr3');
frxReport.PrepareReport;
frxReport.LoadFromFile(ExtractFilePath(Application.ExeName) + REPORT_DIRECTORY + 'report2.fr3');
frxReport.PrepareReport(false);


exporting the preview like this does not cause any problems:
frxPDFExport.ShowDialog := true;
frxPDFExport.Background := true;
frxPreview.Export(frxPDFExport);
but trying to export the composite report in background with the options dialog disabled results in an Access Violation.

The Problem does only occur on Windows XP.
Couriously i get no exception when first srolling to the last page in the preview and exporting afterwards.

Any hint or help on this highly appreciated

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:28AM
    cannot reproduce here fr4.8.33. d2006, d2010. xp pro+
    what version level and build no are you using.
    if you are exporting in the background you would not be scrolling in the report preview.
    i would expect you have missed setting a property of the export filter.
  • edited 7:28AM
    i'm using d2009 in combination with FR4 Version 4.8.33

    what i ment was if i first scroll to the buttom of the report i can export it afterwards without any problem-


    what kind of property could i've missed. currently i'm setting:
        frxPDFExport.FileName := AFileName;
        frxPDFExport.ShowDialog := false;
        frxPDFExport.ShowProgress := false;
        frxPDFExport.Compressed := true;
        frxPDFExport.Background := false;
        frxPDFExport.Author := 'DIEWE';
        frxPDFExport.Subject := 'Provisionsabrechnung';
        frxPDFExport.OverwritePrompt := true;
        frxPDFExport.UseFileCache := false;
    

    i've allready tried other way to do the export resulting in the same prob:
           frxPreview.Lock;
           frxPreview.Report.Export(frxPDFExport);
           frxPreview.UnLock;
    
    or
           frxPreview.PreviewPages.Export(frxPDFExport);
           frxPreview.UnLock;
    

    THX!


  • gordkgordk St.Catherines On. Canada.
    edited 7:28AM
    why use this code?
    frxPreview.Export(frxPDFExport);
    here is a typical example

    procedure TForm1.Button5Click(Sender: TObject);
    begin
    frxreport5.LoadFromFile('mypo.fr3');
    frxreport5.PrepareReport;
    frxreport5.LoadFromFile('myotherpo.fr3');
    frxreport5.PrepareReport(false);
    frxpdfexport1.OpenAfterExport:= true;
    frxpdfexport1.ShowDialog := false;
    frxpdfexport1.FileName:= 'mypo.pdf';
    frxreport5.Export(frxpdfexport1);
    end;

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.