04 April 2016
The report generator may be invoked in following ways
Manually, by selecting a valid report definition. The report definition may be global or context sensitive. Global means that the report definition is not dependent upon a specific object and context sensitive means that the report definition needs a specific object as input to be able to create the report.
Automatically triggered by an event, for example when an object is promoted to a specific lifecycle state or when an object is revised a report could be generated automatically.
Manually, by invoking a custom command (URL) that explicitly uses one pre-defined report definition
From the Side Panel in the TVC Structure Browser
Through a command line invocation
In either one of the scenarios above, exactly how the report will be generated and what will happen to the generated output is defined in the Report Definition object (configuration object), which is used.
There are a number of different Report Definition types that can be used. They are all described in this chapter.
A global report is not dependent upon a specific object as input. An example of such report could be, to query the database for all ECR’s and show the status of those.
The command used to invoke the global reports is called "TVC Show Global Reports". This command should be located where it’s easy reachable for the user, for example in the menu called "Toolbar" (please note that this name might vary between different ENOVIA versions).
The report definition configuration defines whether or not the report is global.
Context reports, i.e. reports that requires a business object as start object, is most commonly available from the category tree.
The command used from the category tree to display the available reports is called "TVC Show Reports". This command can be added to an object type category in order to make it available for the user. Figure 3 below shows the category tree for a Part instance with such command attached.
The command is by default not attached to any category tree after installation, but following MQL command can typically be used to add the command to the Part type category tree (the same command could of course be attached to any type_ABC menu):
<MQL> modify menu type_Part add command "TVC Show Reports";
The creation of a report could be done from a triggered event. The report generator contains a JPO called TVCReportGenerator that wraps the logic to create a report.
First, create a trigger program object similar as shown below.
Next, define the attributes of the trigger program object, as shown in the picture below.
Next, attach the program to the desired event as shown below:
You can invoke the report generator from MQL like the example below illustrates.
<MQL> set context user creator password zzz; <MQL> execute program TVCReportGenerator –method mxMain -report=R-002 -oid=1234.5678.90123.4567;
Remember that you need the tvc JAR files in the MX_CLASSPATH, including the tvc.license file.
Also note if you are using report definitions stored as XML files below the /WEB-INF/tvc folder of your web-application, you need to set an environment variable before starting your MQL session.
Example:
set TVC_WEBAPP_DIR=d:/Tomcat/webapps/enovia
Otherwise the Report Generator cannot resolve the XML files that are used.
There is a way to initiate the report generation without allowing the user to select a report definition. A custom command with properties as below may be created and added to an appropriate place within the application.
<MQL> add command "My Test Report" href "${ROOT_DIR}/tvc-action/beginCreateReport?reportDefinition=Test" label "My Test Report" alt "My Test Report";
The table below shows the URL parameters that can be passed to the server.
Parameter | Description |
---|---|
reportDefinition |
The name or the object ID of the report definition object to use (required). For XML based reports use the XML definition e.g. tvc:report/Report.xml |
objectId |
The object ID of the object the report will be made for (in case of structural reports). (This parameter is added automatically when the command is used from a category tree or from a table context). |
The command can have its "Target Location" setting pointing to a hidden frame; in this case you need to add the parameter "openPopup" with value set to true to the URL in the command. By default, the "beginCreateReport" end-point assumes that it is being opened inside a popup window.
A common use case is to create multiple reports (one report for each selected object, where the selection of objects typically is done within a table). In such case, the user will just have to fill in values on the pre process page (if such is used) one time, and those are applied to all reports.
When multiple reports are being created, each report is created individually, meaning that any output handler is executed for each report. However, if the report is configured for on-demand delivery, the report generator will collect all created reports within one ZIP file.
To create multiple reports, one need to create a command or link that has the following characteristics:
${ROOT_DIR}/tvc-action/rgCreateMultipleReports?reportDefinition=tvc:report/MyDefinition.xml
In addition, you need to supply the selected objects. This is done by passing the object ids using the parameter "objectId" or "emxTableRowId". NOTE: You need to supply at least one object.
If the link is opened in a popup window, you should also provide the parameter "openPopup=false". If the link is opened in a hidden frame, the popup window is automatically created.
If the TVC Structure Browser is available, you can increase the usability of the report generator.
When working inside the TVC Structure Browser, a common use case for the user is to be able to create a report against one of the objects inside the table / structure. The normal steps to do this, would be to open the desired objects category tree (emxTree.jsp) page and select the reports page from there, and then select the report to create. This is not only a time consuming task, it also makes it harder for the user to come back to the structure and continuing the work he/she was doing before creating the report.
A better approach would be to utilize the side panel and display the available reports in there, for the selected object. This is exactly what the command "TVC Show Reports In Sidepanel" does. It is installed with the report generator, and can be added to any toolbar-menu or context menu inside the structure browser.
When this command is invoked, the available reports for the selected object will appear in the side panel and the user can create the report directly from the structure browser without the need for leaving the page.
An example screenshot is shown below:
It is possible to invoke the report generator from the command line. When TVC is installed, you will get a directory under the WEB-INF folder in the web-application called "reportgenerator". Within this directory, there is a script file available called "Client". The script itself contains further information how to launch the report generator.