Warning, /libraries/kreport/KReportScript.dox is written in an unsupported language. File is not indexed.
0001 /** 0002 * \mainpage 0003 * 0004 * KReport is a library for the generation of reports in multiple formats. 0005 * 0006 * It contains support for user generated scripts written in Javascript. 0007 * This document describes the user facing API for controling reports. 0008 * 0009 * Concepts 0010 * ======== 0011 * 0012 * KReport user scripting has the following concepts: 0013 * * The top-level report object \n 0014 * This contains functions for retreiving the report name, section objects and item objects \n 0015 * It also contains event handlers which are executed at open, complete, and newPage events \n 0016 * 0017 * * Section objects \n 0018 * Sections contain function for receiving the section name, setting the background colour,\n 0019 * and retreiving items within the section.\n 0020 * It also contains event handlers which are executed when the section is rendered\n 0021 * 0022 * * Item objects \n 0023 * Items contain functions to manipulate item specific properties prior to drawing them on screen \n 0024 * 0025 * * Generic objects \n 0026 * * debug - contains functions for printing debug messages. See KRScriptDebug. 0027 * * draw - contains functions for drawing basic shapes on the canvas of a report. See KRScriptDraw. 0028 * * constants - contains some userful constant data. See KRScriptConstants. 0029 * 0030 * * In addition to the above, applications can add their own functions to the report engine, Kexi adds: 0031 * * field - contains functions or retreiving field values, and agggregate values. 0032 * 0033 * 0034 * Adding basic scripting to a report 0035 * ================================== 0036 * 0037 * To add basic scripting to a report, it is nescessary to perform the following steps: 0038 * * Create a script object 0039 * * Within the object implement handlers for one or more events 0040 * * Assign the script objet to the appropriate report object so that it an be executed 0041 * 0042 * Example 0043 * ======= 0044 * 0045 * The following javascript snippet contains a basic object with no methods 0046 * 0047 * \code 0048 * function detail() 0049 * { 0050 * } 0051 * \endcode 0052 * 0053 * We then add a handler for the OnRender() event with a single method 0054 * 0055 * \code 0056 * function detail() 0057 * { 0058 * this.OnRender = function() 0059 * { 0060 * debug.print("Rendering a detail section"); 0061 * } 0062 * } 0063 * \endcode 0064 * 0065 * Finally we assign this script object to the actual report object by calling: 0066 * 0067 * \code 0068 * reportname.section_detail.initialize(new detail()) 0069 * \endcode 0070 * 0071 * where reportname is the name of the report 0072 * 0073 * It is possible to assign script objects to report objects this way for any of the report sections, 0074 * and the main report object. 0075 * 0076 * See Scripting::Report and Scripting::Section for a starting point. 0077 0078 0079 */ 0080 0081 // DOXYGEN_SET_PROJECT_NAME = KReport 0082 // DOXYGEN_SET_IGNORE_PREFIX = KReport K