]>
A renderer specifies how an tag in the report template is to render. A good example is to render the use of the svg renderere using the PHP SVGGraph library, as in the {state_summary_report} sample report:
... ...Use the content of this tag to override the title of the report. This allows both the page title and the tab title to be replaced by token replaced values in the report.
As an illustration of how to use this renderer, consider the {user_distribution_report} sample report:
Because of the attributes we added to the h2 HTML tag here (any HTML tag will do) the existing "2. Report that filters based on state lookup" title will be ignored.
Moreover, because of the name token included in this h2 tag, the rendered title will be dynamic.
For another illustration of this renderer, checkout the video about Dynamic page titles in reports.
Displays the user's list of reports (excluding hidden reports), optionally limited to a single category, as in this example:
The above sample shows a list of all non-hidden reports in category Sample, using the category as the header generated by the following code:
The following attributes are supported for the FrxMyReports renderer:
frx:category | Limit the list of reports to be shown to a particular category. Multiple categories may be used by specifying category_2 and category_3 attribtues accordingly. |
---|
The FrxSource renderer displays markup as a code snippet. No token replacement is done for the children and all embedded code is escaped html. This is used in the {tutorial_reports} to display the source of reports.
This renderer is used throughout the documentation as follows:
Embedded xhtml that you want displayed as source including {tokens} that you want to display without being replaced
Displays the XML of the current data context, which is particularly useful for debugging purposes. If you embed this in a report, it will show you the XML data source that is used for token replacement, so it can give you a good idea as to what data is being returned and which tokens can be used.
Here is a sample that is displayed using the FrxXML renderer which shows the data returned by the datablock:
Be aware however that this FrxXML renderers removes XML comment lines (e.g. those used to specify {datablock_security} in XML format).
The above example was generated with the following code:
Customize the standard report parameters input form. Use it on a div tag anywhere within the body part of your report to control various aspects of the rendering of the parameter form, as in the {role_detail_report} sample report, for which the .frx file includes these lines:
...Role Description: {role}
Select a role and hit the button to run the report.
{submit}
The above example illustrates the following FRX attributes supported by the FrxParameterForm renderer:
frx:title | The title of the parameters field set. |
---|---|
frx:collapsible | Indicate if the form should be collapsible or not:
|
frx:collapsed | Indicate how a collapsible parameter form should be shown:
|
frx:submit | The label of the submit button. |
The children of the FrxParameterForm div allow you to specify the exact layout of the parameters form using Forena's token replacement syntax, which is illustrated in the above example via the content of the 3 paragraphs contained in the FrxParameterForm div. The default context is changed to be the rendered parameter form, so that the parameter ids will allow replacement of a form control.
Note: The parameter form is always rendered at the top (even if you would move it after the data blocks to be rendered).
Render a graph using the SVG format, using the {setup_svggraph_report}. Make sure to install this library prior to using this renderer.
We'll use the {state_summary_report} sample report to illustrate how to use this renderer, for which the .frx file includes these lines:
The following attributes are supported for the FrxSVGGraph renderer:
frx:type | The type of graph to be rendered. If omitted, then BarGraph is assumed. These are the currently
supported types of graphs:
|
---|---|
frx:xpath | The XPATH expression for the data to be graphed (e.g. *[total>10000], which is what is used in the sample (note that only states are included in the graph that have a total above 10000). If omitted, then an XPATH expression of * is assumed and all data is graphed. |
frx:link | Create a hyperlink for the data to be graphed (e.g. sample.user_distribution_simple?state={state}. Use feild tokens to generate the link dynamically . |
frx:series | The column containing the series of the graph. Multiple series may be specified using an attribute of frx:series_1 for the first series, frx:series_2 as the second and so on. |
frx:label | The label that should be used for the series. Usually this is specified using tokens (e.g. {state} in our sample). |
frx:options | This legacy attribute is currently still supported, but it is recommended to replace them by the corresponding frx:xyz
attributes. Here is a sample of it was used: frx:options="series[]={total}&label={state}&colors[]=green&colors[]=yellow" |
In addition to the attributes mentioned above, any attribute supported as PHP SVGGraph options may be included as frx attributes also. Here are a few examples of some often used attributes:
frx:color | Specify a graph color (e.g. frx:color="{color}"). To specify multiple graph colors, you can specify frx:color_1="red" and frx:color_2="blue" also. |
---|---|
frx:width | Width of the graph to be rendered (e.g. frx:width="720"). If omitted, then 600 is assumed. |
frx:height | Width of the graph to be rendered (e.g. frx:height="480"). If omitted, then 400 is assumed. |
Here is an example:
Note: checkout the {svggraph_library} documentation to fully understand those options.
This renderer includes another report as an asset with the appropriate tag. The primary use of this renderer is to create references to external SVG assets. When rendered in a web page, these need to be wrapped in embed tags, but when being included in a PDF document the raw SVG should be included. The {state_summary_ie8_report} report uses this renderer, for which the .frx file includes these lines:
The above example illustrates the following FRX attributes supported by the FrxInclude renderer:
frx:src | The relative URL to the report asset that is to be rendered. |
---|---|
frx:height | The height of the report asset that is to be rendered. |
frx:width | The width of the report asset that is to be rendered. |
Some extra details about how this renderer processes various types of assets:
A crosstab table is designed to pivot data, that is to creat a table whose columns are determined by the values in a select statement/data block. The number of columns in a crosstab query is not constant but rather determined by the data returned by the block. It is typically used to conver data of this form:
WA | Female | 100 |
WA | Male | 50 |
ID | Female | 25 |
ID | Male | 30 |
Into a table that looks like:
Female | Male | |
WA | 100 | 50 |
ID | 25 | 30 |
In order to do this you will need to specify a grouping attribute and a dimension attribute. The grouping attribute determines how to group the rows of data while the dimension attribute speicifies which field will be used to create the columns out of.
The layout of the cross tab is follows:
Message | Severity | User Name | Nr of msgs |
---|---|---|---|
{message} | {severity} | {name} | {typecount} |