Knowledge Base: ADMINISTRATION : Custom Reports
 
Custom Reports
Creation Date: February 11, 2008
Revision Date: January 18, 2016
Product: Third-Party (For information only)
Summary
The Custom Reports feature allows you to create your own reports, based on the data provided from the DS-Client database tables. This feature is meant for advanced users.
See Also
“Generating a customized data report”
This feature requires a third-party application (JasperReports), which means you must have the development resources to create and compile the custom report templates. The basic steps for this feature are as follows:
"To select data for the report"
After this step is completed, you will have a Data Set file (XML) containing the structure and data you chose for export. You can actually use the Data Set file to generate a one-time report. If you want to regularly generate a custom report, you must use the structure of the data fields to create and compile a template file.
"Creating a customized report using a third-party application"
See "Creating a customized report using a third-party application" for general instructions on how to make the template. Refer to the corresponding third-party documentation for the most up-to-date information.
"Generating a customized report"
After you have created a custom report template, place it in the \report sub-folder of the GUI you are using. The GUI will then be able to generate the custom report.
Creating the customized report template requires a third-party application. This depends on the type of GUI you plan to use to view the report. See “Java GUI (JasperReports)”.
Java GUI (JasperReports)
You need to download and install the free JasperReports application from http://www.jasperforge.org. These examples use v.3.7.0 of the JasperReports software.
1. With the exported Data Set (XML file), use the third-party jasper tools to create your custom report using the fields from the Data Set.
a) Create a sub-folder named “report” in the folder where the DS-User (dsuser.jar) you want to use is located. Normally, this is in the DS-Client installation path.
The default for Windows is C:\Program Files\CloudBackup\DS-Client
The default for Linux is /opt/CloudBackup/DS-Client/user
The default for Mac is /Library/CloudBackup/DS-Client/user/DS-User.app/Contents/Resources/java/
b) Copy the exported Data Set (XML file) to this directory (i.e. backupset.xml).
2. Open the Jasper Report Designer.
3. Start a new report (File > New). The New File Wizard appears.
4. Select the Blank Letter template and click Open this Template.
The Name and Location screen appears.
a) Enter the Report name (e.g. “backupset”).
b) Click Browse to select the location where the report will be created.
c) When you have made your selections, click Next.
A Finish summary page appears.
d) Click Finish to create the report.
The new document (backupset.jrxml) appears in the designer.
5. Click Report Datasources .
The Connections / Datasources dialog appears. In this screen you can configure the data source for the template.
6. Click New to create a new data source.
7. Select XML file data source in the wizard, and click the Next button.
8. In the above screen, do the following:
a) Input the data source name (i.e. “backupset”).
b) Select the XML data file (the one that was exported in “To select data for the report”).
c) Select Use the report XPath expression when filling the report.
d) Click Save to close the dialog.
9. Select Default for the backup set, then close the Connections / Datasources screen.
10. In the Jasper Report Designer, right-click the report name (i.e. “backupset”), and select Edit Query .
The Report Query screen appears.
11. Select Report Query.
a) Set the query language to XPath.
b) Input a query in the form /<root_element>/* in the text edit area. (In this example backupsets is the root element of the XML data file, thereby requiring the query /backupsets/*.)
c) On the right-side of the dialog, you will see the structure of the XML File.
NOTE:  The root element name may change for different XML data files.
12. Under backupsets (root element), expand the Item branch to display sub-items in the tree.
These are the available data fields that you can use in the custom report.
a) Right-click on an item you want to add to the custom report, and click Add node as field.
b) Add as many items as required.
c) Click OK to close the dialog.
These fields are displayed in the Report Inspector panel of the designer.
By default, all the fields are set to the java.lang.String type. For some fields this may not be a suitable format.
If you need to modify the Field Class Type to the correct type, go to the field properties panel.
d) Set the correct field data type from the Expression Class list.
13. Start designing the custom report.
14. For a preview of the design, click Preview menu > Select preview format > Preview.
15. Click Compile Report .
The report is compiled into a .jasper file that is generated in the “report” directory created in step 1.
You can now generate the custom report from that DS-User installation.
To use another DS-User from a different computer, copy the same .jasper file to the report directory in the corresponding DS-User’s installation path.
See “Generating a customized report”.