WRReport and WRQuickReport
WRReport is the top-level component that provides the graphical HTML view onto a DRReportModel. Below you see a WRQuickReport which is a convenience Component wrapped around a WRReport. Notice the collapsible-content control allowing you to change settings for the display of the report. Also scroll down to the bottom of the page and you'll find where the real power lay. The two rows of buttons are navigation controls for controlling how groups of information are structured on the page. They are analogous to Improv tiles. Two arrow icons pointing to the left and right are labeled with the dimensions that you can move the 'tile' to. Click 'H' and instead of having data grouped by Category and Revenue vertically, you put the selected dimension on the horizontal axis. Click 'Z' and you put the dimension on the z-axis (out of the page). Click the Up or Down arrows and you can flip how items on the same dimension are presented : A split into B or B split into A.
WRQuickReport is a component that takes virtually all the same arguments as WRReport. It includes a few others however so you can use DynaReporter functionality without any other code (other than that to provide a list of objects and model definition string). The example page below has a.wod file with this entry in it:
Custom3: WRQuickReport {
objects = objects;
pathString = pathString;
recordGroupTotalToShow = "revenue";
selectedRecordGroupDisplayType = "SINGLE_TOTAL";
selectedReportStyle = "VERTICAL_ROWS";
showCustomReportStyle = NO;
showNavigation = YES;
showPresentationControls = YES;
showRecordGroupAsTable = NO;
showRecordGroupHeadings = YES;
}objects is a list of Movie EOs in this example.
pathString is pointing at a file that stores a DRReportModel definition, a string in property-list format. This definition is a plist specification for how you want to group and organize attributes for presentation. Instead of pathString, you could bind to plistString
plistString (not used above) is the actual string itself instead of the file that holds it.
criteriaArray (not used above) is an array of DRMasterCriteria objects. If set, then pathString and plistString bindings are ignored and a DRReportModel is created using these objects. If you have an array of DRAttributes, you can provide this as an option with the 'attributeArray' binding.
If you already have a DRReportModel that you created programmatically and wish to reuse it, use WRReport instead ofWRQuickReport. Here's the bindings used in the 'DynaReporterJavaApp' Example:
wrreport: WRReport {
model = session.model;
showNavigation = YES;
showPresentationControls = YES;
showRecordGroupAsTable = NO;
showRecordGroupHeadings = YES;
selectedRecordGroupDisplayType = "TOTALS";
recordGroupTotalToShow = "revenue";
showCustomReportStyle = NO;
selectedReportStyle = "VERTICAL_ROWS";//"NESTED_CELLS";
}showNavigation is a switch that lets you turn off showing the dimensional layout controls (AKA Improv 'tiles')
showPresentationControls is switch to turn off showing all controls in the page (for when you just want to display a static report). Note that when this item is on, the user gets access to a control panel that lets you graphically change the properties set via these bindings.
showRecordGroupAsTable allows you to show the total that appears in a given dimensional cell with just its representative total(s) or with an nested HTML table showing all the records that met the criteria of the dimensional intersection
showRecordGroupHeadings allows you to turn off showing Column headings describing attributes
selectedRecordGroupDisplayType can be three different values determning how WRReport should show a cell: 'TOTALS' (for showing all the representative totals of the group of records), 'SINGLE_TOTAL' (for showing just one total instead of all the attributes that have been marked totalable), or 'TABLE'(show the entire table of all totals and all records and all their attributes in each cell)
recordGroupTotalToShow allows you to specify the attribute name to total when specifying SINGLE_TOTAL for selectedRecordGroupDisplayType binding.
showCustomReportStyle lets you disable WRReport's default HTML table layout but leaving all its control features available.
selectedReportStyle lets you choose from currently just two styles: 'VERTICAL_ROWS' which only works when showing the TABLE selectedRecordGroupDisplayType. 'NESTED_CELLS' is used for all other reporting or when VERTICAL_ROWS is not compatible with the style being displayed. VERTICAL_ROWS was optimized to show records as well as their totals. NESTE_CELLS was optimized for showing cross tabular spreadsheet layouts where you have totalling in two dimensions on the page. Note that to actually see a VERTICAL_ROW report properly with the TABLEselectedRecordGroupDisplayType set, you need to make sure you are viewing now deminsions along the horizontal axis (all tiles must be on either the Z or vertical axis).
colors is an array of strings that lets you set the colors to use in cells associated with different dimensional labels as well as total cells when using the NESTED_CELLS report style. The default array of of colors used are these strings: "c6c3af", "b7af4b", "d5ba27", "ffec00" which I call the Starbucks(tm) palette. This parameter is only available as a binding (there is no control in the layout control panel that lets you set it graphically, interactively)