Chapter 12. PHP language API reference

Table of Contents

12.1. The OpenCReports PHP module
12.2. The OpenCReport class
12.3. High level PHP API
12.3.1. Constructor
12.3.2. Load a report XML description
12.3.3. Set report output format
12.3.4. Get report output format
12.3.5. Get report output format name
12.3.6. Set report output parameter
12.3.7. Run the report
12.3.8. Dump report result
12.3.9. Get report result
12.3.10. Get report content type
12.3.11. Get library version
12.4. Low level PHP API
12.4.1. Numeric behavior related methods
12.4.2. Locale related methods
12.4.3. Data source and query related methods
12.4.4. Expression related methods
12.4.5. Layout part related methods
12.4.6. Callback related methods
12.4.7. Environment related methods
12.4.8. Add "m" domain variable
12.4.9. Result related methods
12.4.10. Path related methods
12.4.11. Color related methods
12.5. The OpenCReport\Datasource class
12.5.1. Free a datasource
12.5.2. Add a query to the datasource
12.5.3. Set datasource encoding
12.6. The OpenCReport\Query class
12.6.1. Get result for a query's current row
12.6.2. Start navigation for a query
12.6.3. Navigate to the next row
12.6.4. Navigate use previous/next row
12.6.5. Add a query follower
12.6.6. Add an N:1 query follower
12.6.7. Free a query
12.7. The OpenCReport\QueryResult class
12.7.1. Get number of columns for a query result
12.7.2. Get the nth column name for a query result
12.7.3. Get the nth column result for a query result
12.8. The OpenCReport\Expr class
12.8.1. Free an expression
12.8.2. Get the original expression string
12.8.3. Print an expression
12.8.4. Get the number of expression tree nodes
12.8.5. Resolve an expression
12.8.6. Optimize an expression
12.8.7. Evaluate an expression
12.8.8. Get the result of an expression
12.8.9. Set expression result to a string value
12.8.10. Set expression result to a long value
12.8.11. Set expression result to a double value
12.8.12. Set expression result to a numeric value from string
12.8.13. Get number of operands of a expression
12.8.14. Get nth operands' result of a expression
12.8.15. Compare the expression's current and previous results
12.8.16. Initialize expression results
12.8.17. Get string value of an expression
12.8.18. Get long value of an expression
12.8.19. Get double value of an expression
12.8.20. Get numeric value of an expression as a string
12.8.21. Set nth result of an expression to a string value
12.8.22. Set nth result of an expression to a long value
12.8.23. Set nth result of an expression to a double value
12.8.24. Set iterative start flag of an expression
12.8.25. Set expression to delayed
12.9. The OpenCReport\Result class
12.9.1. Free a result object
12.9.2. Copy a result object
12.9.3. Print a result object
12.9.4. Get result object value type
12.9.5. Detect whether result object value is NULL
12.9.6. Detect whether result object value is a string
12.9.7. Detect whether result object value is a number
12.9.8. Get string value of a result object
12.9.9. Get numeric value of a result object as a string
12.10. The OpenCReport\Part class
12.10.1. Get the next report part
12.10.2. Create a new report part row
12.10.3. Get the first report part row
12.10.4. Add iteration callback for the part
12.10.5. Check whether two parts are identical
12.10.6. Set or get number of part iterations
12.10.7. Set or get part font name
12.10.8. Set or get part font size
12.10.9. Set or get paper type
12.10.10. Set or get part orientation
12.10.11. Set or get part top margin
12.10.12. Set or get part bottom margin
12.10.13. Set or get part left margin
12.10.14. Set or get part right margin
12.10.15. Set or get part suppression
12.10.16. Set or get suppression of the page header on the first page
12.10.17. Get the part's page header
12.10.18. Set the report object for the part's page header
12.10.19. Get the part's page footer
12.10.20. Set the report object for the part's page footer
12.11. The OpenCReport\Row class
12.11.1. Get the next part row
12.11.2. Create a new part column for the row
12.11.3. Get first column of a part row
12.11.4. Set or get suppression for the part row
12.11.5. Set or get new page for the part row
12.11.6. Set or get layout type for the part row
12.12. The OpenCReport\Column class
12.12.1. Get next column
12.12.2. Create a new report in the column
12.12.3. Get first report of a part column
12.12.4. Set or get part column suppression
12.12.5. Set or get part column width
12.12.6. Set or get part column height
12.12.7. Set or get border width
12.12.8. Set or get border color
12.12.9. Set or get number of detail columns
12.12.10. Set or get column padding
12.13. The OpenCReport\Report class
12.13.1. Get the next report
12.13.2. Create a new report variable
12.13.3. Create a new custom report variable
12.13.4. Get the first variable of a report
12.13.5. Parse and expression for the report
12.13.6. Get the error after a failed expression parsing
12.13.7. Resolve variables of the report
12.13.8. Evaluate variables of the report
12.13.9. Create a new report break
12.13.10. Get a report break by its name
12.13.11. Get the first report break
12.13.12. Resolve breaks of the report
12.13.13. Get the current row number of the main query
12.13.14. Add a "report start" callback
12.13.15. Add a "report done" callback
12.13.16. Add a "new row" callback
12.13.17. Add an "iteration done" callback
12.13.18. Add a "precalculation done" callback
12.13.19. Check whether two report objects are the same
12.13.20. Set the report's main query
12.13.21. Set the report's main query by name
12.13.22. Set or get the report suppression
12.13.23. Set or get number of iterations for the report
12.13.24. Set or get the font name for the report
12.13.25. Set or get the font size for the report
12.13.26. Set or get the report height
12.13.27. Set or get the report's field header prioroty
12.13.28. Get output sections of the report
12.14. The OpenCReport\Variable class
12.14.1. Get the base expression of a variable
12.14.2. Get the ignore expression of a variable
12.14.3. Get the first intermediary expression of a variable
12.14.4. Get the second intermediary expression of a variable
12.14.5. Get the result expression of a variable
12.14.6. Get the variable type
12.14.7. Get the variable precalculated flag
12.14.8. Resolve expressions of a variable
12.14.9. Evaluate expressions of a variable
12.14.10. Get the next variable of the same report
12.15. The OpenCReport\ReportBreak class
12.15.1. Get next break
12.15.2. Add a breakfield to a break
12.15.3. Check breakfields
12.15.4. Reset variables associated with a break
12.15.5. Add a "trigger" callback to a break
12.15.6. Get the name of a break
12.15.7. Get output sections of a break
12.16. The OpenCReport\Output class
12.16.1. Set or get suppression of the output section
12.16.2. Add a (text) line
12.16.3. Add a horizontal line
12.16.4. Add an image
12.16.5. Add a barcode
12.16.6. Add an image end marker
12.16.7. Get the first output element
12.17. The OpenCReport\Line class
12.17.1. Set or get the font name for the line
12.17.2. Set or get the font size for the line
12.17.3. Set or get the font's bold flag for the line
12.17.4. Set or get the font's italic flag for the line
12.17.5. Set or get line suppression
12.17.6. Set or get text color for the line
12.17.7. Set or get background color for the line
12.17.8. Add a text element to the line
12.17.9. Add an image element to the line
12.17.10. Get the first line element
12.18. The OpenCReport\HorizontalLine class
12.18.1. Set the line width
12.18.2. Set or get the line alignment
12.18.3. Set or get the line indentation
12.18.4. Set or get the line length
12.18.5. Set or get the line's font size
12.18.6. Set or get the suppression flag for the line
12.18.7. Set or get the line color
12.19. The OpenCReport\Image class
12.19.1. Set or get the file name of the image
12.19.2. Set or get the suppression flag for the image
12.19.3. Set or get the image type
12.19.4. Set or get the image width
12.19.5. Set or get the image height
12.19.6. Set or get the image alignment
12.19.7. Set or get the image background color
12.19.8. Set or get the image "text width"
12.20. The OpenCReport\Text class
12.20.1. Set literal value
12.20.2. Set or get expression value
12.20.3. Set or get delayed flag for the field expression
12.20.4. Set or get the format string for the field expression
12.20.5. Set or get the translation flag for the field expression
12.20.6. Set or get the field width
12.20.7. Set or get the field alignment
12.20.8. Set or get the field text color
12.20.9. Set or get the field background color
12.20.10. Set or get the field font name
12.20.11. Set or get the field font size
12.20.12. Set or get the field's bold flag
12.20.13. Set or get the field's italic flag
12.20.14. Set or get the field's link
12.20.15. Set or get the field's memo flag
12.20.16. Set or get the field's "wrap at characters" flag
12.20.17. Set or get the field's maximum number of lines
12.21. The OpenCReport\Barcode class
12.21.1. Set or get the barcode value
12.21.2. Set or get the barcode value delayed
12.21.3. Set or get the barcode suppression
12.21.4. Set or get the barcode type
12.21.5. Set or get the barcode width
12.21.6. Set or get the barcode height
12.21.7. Set or get the barcode image line color
12.21.8. Set or get the barcode image background color
12.22. The OpenCReport\OutputElement class
12.23. The OpenCReport\LineElement class
12.24. RLIB compatibility API
12.24.1. Initialize a report
12.24.2. Destroy a report
12.24.3. Get library version
12.24.4. Add a MySQL/MariaDB datasource
12.24.5. Add a MySQL/MariaDB datasource from an INI group
12.24.6. Add a PostgreSQL datasource
12.24.7. Add an ODBC datasource
12.24.8. Add an array datasource
12.24.9. Add an XML datasource
12.24.10. Add a CSV datasource
12.24.11. Add a query
12.24.12. Add a resultset follower
12.24.13. Add a resultset N:1 follower
12.24.14. Set datasource encoding
12.24.15. Add a report XML
12.24.16. Add a report XML from buffer
12.24.17. Add a search path
12.24.18. Set locale
12.24.19. Setup translation
12.24.20. Set output format
12.24.21. Add a custom report function
12.24.22. Set output encoding
12.24.23. Add a report parameter
12.24.24. Set an output parameter
12.24.25. Refresh array query contents
12.24.26. Add an event callback
12.24.27. Execute the report
12.24.28. Dump the report output
12.24.29. Get content type
12.24.30. Set radix character
12.24.31. Compile and evaluate an expression
12.24.32. Add graph background region
12.24.33. Clear graph background region
12.24.34. Set graph minor tick
12.24.35. Set graph minor tick by location