Description

Runs Report Builder reports.

Syntax

Run_Report (reportName,list_statement [,options])

Parameters

The Run_Report subroutine has the following parameters.

ParameterDescription
reportNameThe report name. Use the entity name of the fully-qualified entity id.
list_statementList statements may be passed to the function to print reports.
options

Optional. A space delimited string of additional formatting options for reports.

OptionDescription
(P Printer LPTRSends the report to the printer
GridPrints/previews the report with gridlines.
ID-SuppSuppresses the display of the key.
Det-SuppSuppresses the detail and gives a summary of the data.
Landscape PortraitThe orientation of the report.
LegalPrints the report on legal size paper.
ScreenPreviews the report
Output file

Output file information. This parameter contains a string in the format of filetype filename.

File DescriptionFileType
Comma delimited fileCSVFILE
Text fileTXTFILE
PDF filePDFFILE
HTML fileHTMLFILE
HTML file with pagesHTMLPAGE
DHTML fileDHTMLFILE
DHTML file with pagesDHTMLPAGE
RTF fileRTFFILE
MarginsA comma-delimited string of sizes in inches. The margins should be passed as LEFT,TOP,RIGHT,BOTTOM.

Note: The reportName and list_statement parameters are mutually exclusive.

Remarks

The Run_Report function will execute using the active cursor, so a SELECT prior to a Run_Report call will use the results of the SELECT.

See Also

Appendix E: Run_Report Reference

Example

 

Declare Subroutine Run_report
 
* Run an existing report
rptName = 'MY_REPORT'
Run_Report(rptName,'')
 
* A simple list statement
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR"
Run_Report('',stmt)
 
* A simple list statement creating a PDF file
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR"
Run_Report('',stmt,'PDFFILE C:\TEMP\MY_PDFILE.PDF')
 
* Run an existing report to the printer with landscape orientation
rptName = 'MY_REPORT'
Run_Report(rptname,'','(P LANDSCAPE')
 
* Run an existing report using a previously executed select.
 
stmt = "SELECT BOOKS WITH AUTHOR [] 'CLANCY'"
RList( stmt, 5, "", "", "" )
error = Get_Status( errCodes )
if error then
   Fsmsg( errCodes )
end else
   Run_Report( "MY_REPORT", "", ""  )
end