Filters are nothing more that iterator blocks that execute a filter query, then iterate over the results; however, since this is a key component of the report processor, extra functionality is available and the filter-specific iterator block will be explained here.
CreateFilter |
Creates a temporary filter in memory identified by the specified name. Filter exists only for the scope of the report execution. The following tags can be used inside the CreateFilter block to define the query:
Example: <<CreateFilter: ReportData, AP Issues>> <<Columns: IssueNumber, Vendor.VendorName>> <<Sort: Vendor.VendorName>> <<Where: Vendor.Name = "Caps R Us" >> <<Or>> <<Where: Vendor.Name = "Drafting & Equipment" >> <<End>> <<Filter:~ReportData>> <<@IssueNumber>> - <<@Vendor.Name>> <<End>> |
---|---|
FormattedFilter |
Executes the named filter and creates a pre-formatted HTML table to include in the report. While the layout of this table is determined by the HTML auto-generated, many styles have been referenced to provide some customization of the final look. Example: <<FormattedFilter: Open Incidents>> <<!- Optional Settings can go here-->> <<End>> Example: <<Filter: All Items Filter>> <<@Attribute>><br> <<End>> |
Filter |
Executes the contained template block once for each results row of the named filter query. A check is made for the named filter in local memory, and if a filter of this name was created within the report using the CreateFilter tag, this filter is used; otherwise, the processor fetches the query by name from the persisted configuration. A filter query will be execute as defined, but can also be supplemented before execution with the following tags:
See CreateFilter, above, for an example use of these tags. |
ObjectToXML |
Only valid when inside a filter iteration (or anything else that produced a ViewData type result in the future). This provides a minimal, yet simple, way to build large XML-based collections of data all built via filters. Nested filters can be used to any number of levels deep to list dependent objects in the XML, as needed. Simple XML nodes are created per filter display attribute. Example: <Issues> <<Filter: Issues - All Issues>> <<ConstrainToParent: No>> <Issue> <<ObjectToXML: 8>> <Events> <<Filter: Events - All Events>> <Event> <<ObjectToXML: 16>> </Event> <<End>> </Events> </Issue> <<End>> </Issues> Note that most blank lines and horizontal spacing in the source template will be manifested in the output, so once a template is proven to render correct data, it may be desirous to make a pass through and condense as much indentation and spacing as possible. Of course it remains possible to output each XML node manually. |
CVSFileFormat |
Implemented only for FormattedFilter blocks, otherwise ignored.Instead of HTML, the results from the filter's execution will be provided in simple comma-separated value (CSV) format. This allows importing into Microsoft Excel or any other tool that can consume CSV data. Example: <<RP-2.0>> <<Application:Simple External Class Test>> <<FormattedFilter: All Simple External Class Persons>> <<CSVFileFormat>> <<ConstrainToParent: false>> <<End>> The CSV tag has an simple option (ex: <<CSVFileFormat: NoHeader>>) that will suppress the first line of the CSV data that represents the HEADER which automatically inserts column names for each piece of data. This allows the template to provide custom/clearer column names, if desired. |
ForCount |
If specified inside a filter block, this will execute the filter ONLY for count and there will be no results to iterate over. The block's result count will be set to the count returned by the filter. |
MaxResults |
If specified inside a filter block, will limit the number of rows returned by the filter. For example, if you execute a filter sorted by OrderAmount descending and specify <<MaxResults: 10>> the filter will return only 10 rows, which would correspond to the top 10 orders found. |
UPopLinks |
Implemented only for FormattedFilter blocks, otherwise ignored. This will wrap the first column's data of each filter result displayed with HTML to produce a Unity Pop link to open the corresponding object directly. |