Inside Activate
Development
How to create Reports in Activate V8
29 min
in previous versions of activate, reports used to be built using the microsoft report builder this has been deprecated in v8 and replaced with the activate web grid this document explains how to build a new report using the activate web grid in v8 the instructions assume that you are using a sql script or sql query as your data source setting up the report open activate studio open the existing report create a new webform parameter and call it detaildatawebform within the new webform add an activatedatasource control within the activatedatasource set the following properties activatedatasource properties true 330,329left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type add the activatewebgrid control beneath the activatedatasource within the activatewebgrid set the following properties activatewebgrid properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type add the columns to display in the report there are different column controls available, with the two common ones being the activategridcolumn and objectlinkcolumn the activategridcolumn is used to display static data, whereas the objectlinkcolumn can be used to provide a link to allow the user to open an object property page (e g job properties) when using an activategridcolumn set the following properties activategridcolumn properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type optional properties objectlinkcolumn additional properties when using an objectlinkcolumn in addition to the properties available on the activategridcolumn, the following must be set true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type optional properties report parameters report parameters need to be constructed within their own webform (it is recommended that the form is called a meaninful name like selectionwebform) you will need to ensure arguments have been setup as this will be required to set default values like the date range if your report is using a sql script, you will need to handle when the parameter is null within the where statement this is done by using the isdefined function – e g %=isdefined(=/user, "and targetuserguid = '%=/user/guid%'\\")% daterangepicker controls when adding a daterangepicker control you may wish to default the initial option that is displayed when the report loads to do this you need to set the initial value in the job arguments (assuming range is the activatebind) \<range> \<value>last7days\</value> \</range> you will then use the range/to and range/from arguments in the where statement of your sql script for example where submittime between '%=format("{0\ s}",=//job/range/from)%' and '%=format("{0\ s}",=//job/range/to)%' final setup this section explains how to complete the setup of the report firstly, you need to decide on how you want the report parameters to be presented there are two styles that you can choose from presented on their own webpage, similar to how they have been done in the out of the box reports in previous versions of activate presented within the filter button on the web grid, which is like the reports in the analytics module report parameters on their own form to present the report parameters on their own form you will need to setup the web wizard with two system/form pages the first system/form page needs to be configured with the following properties set first system/form page true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type the second system/form page needs to be configured with the following properties set second system/form page true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type optional properties report parameters presented in the filter button to present the report parameters within the filter button you will need to do the following setup a web wizard and add a single system/form page on the system/form page set the following properties single system/form page true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type optional properties open up the webform that contains the activatewebgrid (e g detaildatawebform) and set the filterform property on the web grid with the name of the webform containing the report parameters advanced setup adding toolbars when setting up a report you may wish to display a toolbar which contains buttons to take the user to additional pages, or to provide a refresh and/or export button you can also display certain report parameters outside of the filter (e g date range) to do this you will need to setup a parent form and then nest webforms within it the following example explains how to permanently display the date range parameter and add a refresh button to the toolbar create a new webform and call it something like daterangewebform add the daterangepicker control to it, and then configure it set the autopostback property to true on the daterangepicker control if you have the daterangepicker control on the webform containing the other report parameters, you will need to remove it create a new webform and call it something like detaildatatoolbar add a ribbonpanel control within the ribbonpanel, add a ribbonbutton control ribbonbutton properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type create a new webform and call it webform add a stack control within the stack add a flexpanel control within the flexpanel, add two formpanel controls first formpanel true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type second formpanel true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type underneath the flexpanel control add another formpanel, and then set the following properties report formpanel true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type open the web wizard and update the form property on the system/form page and change it to the webform you have just created export to csv the activatewebgrid has a built in export to csv button which will create a csv file containing the displayed data however, there may be occasions where you would like to provide a csv export that contains more information than what is displayed in the grid for example, additional columns or more rows of data that are not constrained by the max rows filter this is done by adding an export button to the toolbar which links to a form containing an activatecsvgrid control create a new webform and call it exportwebform on the new webform add an activatedatasource control, then set the following properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 3 add an activatecsvgrid control, and then set the following properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type optional properties on the root form node, set the following properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type the webform should look similar to the example in the original documentation export ribbonbutton open the toolbar webform, and add a new ribbon button, then set the following properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type when the export button is clicked a dialog will appear with a link to download the exported csv file adding group by it is possible to add a predefined grouping in the activatewebgrid this is done by setting the groupby property with the column that you wish to group by (e g @=/taskname) note it is only possible to group by a single column users can also do ad hoc grouping in the reports using the group by button but this will not change the predefined groupby setting in the report please note the datasource is assumed to be sorted by the group by column if this is not the case then please set the bindingsort as well bindingsort the default action is to assume that the datasource is sorted sorting the datasource in sql is normally the most efficient method however, you can sort within the grid this is a ; separated list of expressions that are used to sort the list for example @=/name will sort by the name @=/group;@=/name will sort by the group and then the name of the object footer values it is also possible to add a footer to each column this can be used to create a sum, count or average of the column values true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type pivot tables one of the new features in v8 is the ability to create pivot tables these are done by setting the properties within the pivot section of the activatedatasource properties true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type an example of a report that is using the pivot table feature is the job history monthly report (/reports/job reports/task reports/job history monthly)