PDF Export in FR3

edited 3:01AM in FastReport 3.0
As soon as i finished installing I got down to business immediatley, with particular focus on the frxPDFExport.

I however got an error when I tried the following code.


frxPDFExport1.FileName := 'c:\testfile.pdf';
frxPDFExport1.OpenAfterExport := True;

frxReport1.PrepareReport();
frxReport1.Export(frxPDFExport1)

What is the correct way to use the Exprot?

Regards
Kimo

Comments

  • edited 3:01AM
    Your code works fine for me.
  • edited 3:01AM
    I keep getting AV and memory addresses.

    I was checking and the demo does not have a frxExport on the main form while all other export filters are there.
  • edited 3:01AM
    It is allowed because of:
    procedure TForm1.FormShow(Sender: TObject);
    begin
    WPath := ExtractFilePath(Application.ExeName);
    Tree.Items[0].Item[0].Selected := True;
    TfrxPDFExport.Create(nil);
    end;
  • edited 3:01AM
    You may get AV because report is empty (load it by LoadFromFile before running).
  • edited 3:01AM
    This was the code with a loaded report that keep giving AVs.

    frxPDFExport1.FileName := 'c:\testfile.pdf';
    frxPDFExport1.OpenAfterExport := True;
    frxReport1.LoadFromFile('c:\reportfile.fr3')
    frxReport1.PrepareReport();
    frxReport1.Export(frxPDFExport1)

    THis code works fine

    frxReport1.LoadFromFile('c:\reportfile.fr3')
    frxReport1.ShowReport();

    Regards
  • edited 3:01AM
    For testing purposes I opened the demo project and added a frxPDFExport component. Then I added a few lines to make the code look like this:

    frxReport1.ShowReport;

    //Export to PDF
    frxPDFExport1.FileName := 'd:\newfile.pdf';
    frxReport1.PrepareReport();
    frxReport1.Export(frxPDFExport1);

    With this code I would espect the selected report to bring up the preview once then export when the preview is closed.

    Actually I got "List index out of bounds (1)" and I cant see why?

    Regards
    Kimo
  • edited September 2004
    Please make a demo project and send it to me, I'll look at it.
  • gordkgordk St.Catherines On. Canada.
    edited 3:01AM
    Hi Kimo
    Just to let you know
    i removed your exception loger from project and recompiled under d7Pro fr3 pro
    ran the test project you sent under d7Pro w98 acrobat reader 5.01......
    all works ok no problems
    will try later on d7 winxp acrobat 6.? will let you know
    ;)
  • gordkgordk St.Catherines On. Canada.
    edited 3:01AM
    Hi Kimo
    will try later on d7 winxp acrobat 6.? will let you know
    results ok here also no problems
    So code seems ok try removing your exception logger from project and see what happens.
    ;)
  • edited 3:01AM

    Project1
    Access violation at address 00008000. Read of address 00008000.
    OK
  • edited 3:01AM
    FR3 export to PDF not support CJK fonts.
    So, I can't not view Chinese pdf files.
  • edited 3:01AM
    Hi,

    I have used that code to generate a pdf file and works well, however the text doesn't stay justify in pdf file, which when I execute a preview form report the text is justify.
    Anyboby have any ideia how to solve this problem?

    Thank you

    Fernandon

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.