Custom Reporting -- Exporting Relationships and Reports to a Module (4.0.13)

From IHRIS Wiki


A tool has been created that will allow you to simply export a relationship and all related reports and reportViews into a module that you can then share with others.

Enabling the Tool

The tool is part of the exportReport module. This module can be found under Pages->Admin->exportReport. You can also enable this with

php index.php --update=1 --enable=exportReport

from the pages directory of your site.

Using the Tool

Change to the pages sub-directory site directory. The site directory is where your site module file is, e.g. iHRIS-Manage-Demo.xml. Now type this command:

<source lang="bash"> php index.php --page=admin/exportReport </source>

Replace XXX with the relationship you want to export.

When it runs it will ask if you wish to include the relationship in the module. If you created a new relationship, then type Yes. If you want to export new reports or report views then type No.

Next it will display a list of all reports that use the given relationship. Type the number next to the report(s) you wish to include. Just type one number at a time followed by enter. When you've selected all you wish to include type q followed by enter.

For each report you selected, it will now display the list of report views for that report. Again you select the report views you want to include in your module and type q followed by enter when you are finished.

A file will be created called CustomReports-full-XXX.xml in your current directory. The XXX will be replaced by the relationship you chose. If the file already exists it will append numbers like: CustomReports-full-XXX001.xml.

Now you can create a directory in your site modules directory for your new module and then move the configuration file there. Finally enable the module in your site config file if you want it to be enabled by default.

Options

There are a few other default options you can override that will affect the completed module.

--version (--version=4.0.3.2)
Set the version to be used for the module. You can set this when you've made changes and need to make a new module file based on an existing module.
--module (--module=MyReport-relationship)
Set the module name for the module and the filename that will be created.
--display (--display="My Report Module")
Set the display name for the module.
--description (--description="This is my report relationship and report/report view definitions.")
Set the description for the module.

The display and description will appear in the Configure Modules page to further define the module you have created.