Reporting

Top  Previous  Next

ModelRight can be thought of as the source of data for a report.  It contains all of the Model objects and properties that you may want to include in your report.   ModelRight generates reports by first generating XML data containing whatever model information you want.  That XML is then transformed using XSL into whatever report format you like -  HTML or RTF, etc... XML and XSL are W3C standards.

ModelRight provides several sample reports in the form of XSL files that are listed in the XSL Report Files control.  An XSL file contains the XSL code for creating a report from XML data.  For it to work properly, specific XML data must be contained in the XML file that it is applied to.  For example, if the XSL code is designed to create an HTML table of all Materialized Views in the Model, then the XML data needs to have information about the Model's Materialized Views in order for the XSL to work properly.  The XML Data Options allow you to specify the XML data that ModelRight should generate - i.e. the XML data that the XSL file requires.  ModelRight saves your XML Data Options and XML Generation Options selections as comments in the XSL file to make it clear what XML data the XSL file requires and so that the report specification is packaged in a single file.

To change the report output, you need to edit the XSL code that constitutes your report file.   The sample report file "Model Report.xsl" illustrates many ways to navigate and transform the ModelRight XML content.  Also, check out the Downloads section of the website for report files that others have contributed.   Or send ModelRight support an email describing what you would like in your report and we will try to provide it for you.

The Reports builder dialog provides the following controls to help generate reports:

XSL Report Files - lists all of the XSL files in the current Report Files directory (and sub-directories).  The current Report Files Directory is displayed at the top of the dialog.  To change it, you can click the Browse for Folder button in the upper right corner of the dialog and browse to another directory.  When you select a folder, ModelRight will scan that directory and any sub-directories looking for XSL files and display the results in the XSL Report Files control.

XML Data Options - a tree of all of the different types of objects and properties used in the product.  Select the items that you want to be included in your report.  When you run a report, ModelRight will create an XML file that contains data for the options that you selected.

XML Generation Options - options that qualify the XML data that is generated

Local Properties Only - generate data only if the property is locally defined on an object (vs. being inherited or calculated).

Current Model Subset Tables/Views Only - generate Table/View information only for the currently active Diagram

Filter XML Data Options - The list of XML Data Options is extensive and can be a little hard to wade through.  These options are provided to filter the listed objects and properties from display and from generation to the XML data file.

Run - when a report is run, ModelRight will generate an XML file containing the data that has been selected in the XML Data Options control.  It prefixes that XML data in the file with a processing instruction:

<?xml-stylesheet type="text/xsl" href="YourReportFile.xsl"?>

 

where YourReportFile.xsl is the name of the XSL report file that you are running.  This will cause a browser that opens the XML file to use your XSL report file to view the XML data.   ModelRight then launches your web browser and passes the name of the XML data file as a parameter - so the browser will open the file.  You could generate an HTML file by using a command-line prompt and an XSL processor, like msxsl:

msxsl MyReport.XML MyReport.XSL -o MyReport.HTM

 

...and then open that file in your browser.

Execute Shell Command(s) - Enter an XSL processing application's command line that ModelRight should execute when you run a report.  The command should process the XML file into an HTML file (or whatever). You should quote the command and/or arguments if they contains spaces. You can specify multiple commands on separate lines.  You can use the placeholders %XmlFile %XslFile %FileName %InstallDir to refer to those items in the command.  An example of such a command(s) using msxsl is:

"c:\bin\msxsl.exe" "%XmlFile" "%XslFile" -o "%FileName..htm"

"%FileName.htm"

Generating Diagrams and Table/View Images

ModelRight supports embedding images of your Diagrams and various other graphics in your HTML reports.  See the sample report file Model Report.xsl to see examples of each of the following features:

If you select Model/Current Diagram As JPEG in the XML Data Options control, ModelRight will create a file called current_diagram.jpg in a sub-directory called images under the current Report File Output directory.  The file will contain a JPEG image of whatever the current Diagram is.

If you select Model/Model Subset/Diagram/As JPEG, ModelRight will generate a JPEG file for each Diagram in each Model Subset that the Model contains.  The file will  be located in a sub-directory called images under the current Report File Output directory and will be called <diagramid>.jpg - where <diagramid> is the internal object identifier of the Diagram object.  The XML data value of this property will be the file name that was generated.

If you select Model/Model Subset/Diagram/Table Graphics/As JPEG, ModelRight will generate a JPEG file containing an image of each Table in each Diagram.   The file will  be located in a sub-directory called images under the current Report File Output directory and will be called <graphicid>.jpg - where <graphicid> is the internal object identifier of the Table Graphic object.  The XML data value of this property will be the file name that was generated.  A similar property is provided Views and Materialized Views.

If you select Model/Model Subset/Diagram/Table Graphics/Dimensions, ModelRight will generate the position and dimensions of each Table as it appears in each Diagram.   This information can then be used by XSL code to generate an HTML image map for the diagram.  A similar property is provided Views and Materialized Views.

Note:  the XSL report file usually contains references to images in an images sub-directory.  To make sure those references are valid, you need to generate your report to a directory that has the images sub-directory - or create a new images subdirectory under your new report output directory and copy whatever images you are using to it.