====== Run_Report subroutine ====== ==== Description ==== Runs Report Builder reports. ==== Syntax ==== Run_Report(//reportName,list_statement [,options]////)// ==== Parameters ==== The Run_Report subroutine has the following parameters. ^Parameter^Description^ |//reportName//|The report name. Use the entity name of the fully-qualified entity id.| |//list_statement//|List statements may be passed to the function to print reports.| |options|Optional. 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 file|Output 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| |Margins|A 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|Appendix E: Run_Report Reference]] ==== Example ==== 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)