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
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
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.