guides:programming:programmers_reference_manual:chapter_run_report

Run_Report subroutine

Runs Report Builder reports.

Run_Report(reportName,list_statement [,options])

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.
optionsOptional. A space delimited string of additional formatting options for reports.

Option - Description
(P, Printer, LPTR - Sends the report to the printer
(G, Grid output - Sends the output to an Edit table window rather than OIPI
(X, Xband output - Uses the Banded report writer to execute the report.
(B, Banded report -Generates a banded writer report from the R/LIST statement, launches the banded report writer to edit the report\\
ID-Supp - Suppresses the display of the key.
Det-Supp - Suppresses the detail and gives a summary of the data.
Landscape, Portrait - The orientation of the report.
Legal - Prints the report on legal size paper.
Screen - Previews the report
Output fileOutput file information. This parameter contains a string in the format of filetype filename.

File Description - FileType
Comma delimited file - CSVFILE
Text file - TXTFILE
PDF file - PDFFILE
HTML file - HTMLFILE
HTML file with pages - HTMLPAGE
DHTML file - DHTMLFILE
DHTML file with pages - DHTMLPAGE
RTF file - RTFFILE
OIPI file - OIPIFILE
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.

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.

Declare Subroutine Run_report

* Run an existing report to the OIPI preview window
rptName = 'MY_REPORT'
Run_Report(rptName)

* Run a list statement to the OIPI preview window
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR"
Run_Report('',stmt)

* Run a list statement to the OIPI grid window
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR (G"
Run_Report('',stmt)

* A list statement creating a PDF file
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR PDFFILE 'C:\TEMP\MY_PDFILE.PDF'"
Run_Report('',stmt,'')

* A list statement creating a CSV file
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR CSVFILE 'C:\TEMP\MY_CSVFILE.CSV'"
Run_Report('',stmt,'')

* 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 )

* Test @list.active to be sure the select found records before running the report
* Otherwise the report will print all records
if @list.active then
   Run_Report( "MY_REPORT", "", ""  )
end

* Run a list statement using the Banded report writer and the colortheme keyword to apply a style
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR COLORTHEME 'VERDANA' (X"
Run_Report('',stmt)


* Use run report to generate a banded report from a list statement , launch the banded report writer to modify the report
stmt = "LIST BOOKS TITLE AUTHOR BY-DSND AUTHOR COLORTHEME 'VERDANA' (B"
Run_Report('',stmt)
  • guides/programming/programmers_reference_manual/chapter_run_report.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1