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

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.

Getting the Tool

This tool is currently in the development branch. Until the next release you can download the file from here:

[1]

You'll also need the updated CLI.php. You can get that here:

[2]

You will need to copy the CLI.php file to your I2CE/tools directory. You can also copy exportRelationship.php there for future use. This is where it is in the development code and will remain after release.

Using the Tool

To use this tool you need to copy exportRelationship.php to your site directory. This is where your site module file is, e.g. iHRIS-Manage-Demo.xml. Now type this command:

<source lang="bash"> php exportRelationship.php --relationship=XXX </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.