Export Report Without Dialog Box Showing

I have the demo version, trying to make sure FastReports does what I need before purchasing it. One of my requirements is to schedule reports, which means I need a way of exporting reports without user interaction. I have tried the following:

frxPDFExport1.ShowDialog := false;
frxPDFExport1.FileName := Destination.Text;
frxReport2.Export(frxPDFExport1);

but get "List index out of bounds (-1). I can't decide if this is an error on my part, or a limitation of the demo. I would like to know if the above will work, and if not what I need to do to get it to work. I would also like to know if the this is a demo limitation, so I don't go crazy trying to fix a non-existent problem.

-- Larry Maturo


Comments

  • edited 7:54AM
    I finally figured this out myself, since you apparently can't get any help here. I was almost correct for pdf. I had:

    frxPDFExport1.ShowDialog := false;
    frxPDFExport1.FileName := Destination.Text;
    frxReport2.Export(frxPDFExport1);

    You need to add two more statements:

    frxPDFExport1.ShowDialog := false;
    frxPDFExport1.ShowProgress := false;
    frxPDFExport1.FileName := Destination.Text;
    frxReport2.PrepareReport();
    frxReport2.Export(frxPDFExport1);

    The above should work for pdf. It almost works for HTML, except that the html always goes into the directory you run the executable from, and from where the the filename tells it to go.

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.