Running a report

Top  Previous  Next

Calling one of the following two “TfrxReport” methods starts (runs, builds) a report:

 

procedure ShowReport(ClearLastReport: Boolean = True);

 

Starts a report and displays the result in the preview window. If the “ClearLastReport” parameter equals “False” then the report will be added to the previously built report, otherwise the previously built report is cleared (by default).

 

function PrepareReport(ClearLastReport: Boolean = True): Boolean;

 

Starts a report without opening the preview window. The parameter has the same function as in the “ShowReport” method. If the report was built successfully it returns “True.”

 

In most cases it is more convenient to use the first method. It opens the preview window immediately, while the report is being built.

 

The “ClearLastReport” parameter is useful when reports are to be added one to another, as happens in batch report printing.

 

Example:

 

frxReport1.ShowReport;