|
Building a Device Status Report |
Top Previous Next |
|
The AggreGate Reporting facility is useful when you want to get some data in human-friendly printable form. Reports show device activity over time, and other statistical information. This article shows how to create a report that includes the history of a certain device-generated event. We use a time recorder that is connected to AggreGate via Agent. Connecting the time recorder to the server is beyond the scope of this article, so we assume it is already online and visible for the system. Our time recorder generates an event whenever an employee swipes their card. The event contains the cardholder ID, a direction mark (IN when the user enters the area or OUT when he exits) and a timestamp. 1. Creating a New Report To create a new report, find the Reports node (
In the Report Properties window:
It's now time to set the most important parameter of the report -- the Source Data Expression. This expression tells AggreGate Server how and where to get the data for filling in the report template. At the report creation stage, it is also used to get data for auto-generating the report template. We'll use the get function defined in the Events context for fetching event history for the report. This function returns the history of an event in the form of table, one record per event instance. The function accepts four parameters (see its description for details), but we'll specify just the first two and leave the others at default values. In our case, the first parameter is our time recorder's Device context path. We can detect this path by finding Time Recorder in the System Tree and checking its tooltip. Its path is users.admin.deviceservers.agent.devices.3_0:
The second parameter is the name of the event generated by the time recorder. You can find it by browsing the Event Log. There is a special Event column that shows event names. In our case, the event is called event. Our Data Source Expression will consist of a single reference to the get function, with two parameters.
Your Report Properties window should now look like this:
Click OK to proceed. The Report Template Properties window will now open. 2. Configuring Report Template Properties At this point it's necessary to set report template properties. The report template will be automatically generated according to these properties and data fetched using the Source Data Expression specified at the previous step.
Now click OK twice, to proceed. Report template will be generated by the server and you'll be prompted to edit it. Click Yes:
The Report Editor will start, so you could edit the newly generated template. 3. Editing The Report Template The Report Editor is a sophisticated component, but we are not going to perform any complex editing at this point. We only wish to change the report column titles. First, change report scale from 100 to 200%. This will make further editing more comfortable:
Now double-click the header of first column and change it to User ID. Change the header of the third column to Event Date/Time in the same manner. Now select File > Quit to exit Report Editor. Confirm saving changes of report template. New Report node (
4. Viewing the Report To fill the report with recent data and view it, right-click it and select Show Report from the context menu. Your report will open in a Report Viewer and you'll be able to browse, export and print it:
|