Master Reports

A Master Report is a special report definition that includes elements that are to be included in other reports. It's frequently used to provide a template-like frame, often defined with a header, a menu, and a footer, for integration with other reports.

 

About Master Reports

The Master Report concept, introduced in Logi Info v12.1, extends the idea of Shared Elements by providing a special report that contains elements that are to be included in other reports. One common use is to define a Master Report with a header, a horizontal or left sidebar menu, and a footer. Regular report definitions (the "other" reports) then reference the Master Report and, at runtime, the two are merged together.
 

The images above show two typical layouts generated by the Master Report Layout wizard in Logi Studio. On the left, the Master Report includes a header with a logo image and an optional horizontal menu, and a footer. On the right, it includes a header with a "navicon" or "hamburger" icon and a logo image, and a footer. Clicking the icon toggles the visibility of a sidebar with an optional vertical menu.

A Master Report is a regular Logi Info report definition, so you can customize it as much as you'd like. Styling for the common elements (header, menu, footer) are included in standard Logi Info themes and can be edited using the Theme Editor.  

For example, if DevNet was re-created using the two Master Report layouts we saw previously, it might look like one of the images shown above.

However, a Master Report does not always have to be used to provide a header and footer; it can be used to add any elements or structures to other reports.

Back to top

 

The Master Report Elements

A Master Report is a regular Report definition that can include any elements you feel are required.
 

The only element it must have is the Master Report Content element, as shown in the example above. This is the "placeholder" for the content from other report definitions. It tells the Logi Server Engine where to insert the other definitions at runtime. This element has no attributes and only one of them is allowed in a Master Report definition.  

In the other report definitions in your application, add a Master Report element, as shown above. Set its Report Definition File attribute value to the name of your Master Report definition (tokens may not be used here). This will cause the integration of the definitions at runtime.

Back to top

 

Creating a Master Report

The easiest way to create a Master Report is to use a special wizard in Logi Studio:
 

You can launch the wizard from Logi Studio's main menu Design tab, as shown above.  

The wizard will first prompt you for a name for the Master Report definition, as shown above. When created, the definition will appear in Studio in the Application Panel along with all your other Report definitions. Click Next to continue.  

Next, you'll be asked to select the structure of the Master Report, as shown above. If you select the sidebar, an icon for toggling its visibility will appear in the header. Click Next to continue, then Finish in the next dialog box.

The wizard will generate and open a new definition, with all of the elements required for the layout you selected, and will include a Master Report Content element.

If you have a Report definition open in the editor, the wizard will automatically insert a Master Report element, configured for your new Master Report, into it.

If you prefer, you can create a Master Report definition from scratch, without using the wizard.

Back to top

 

Customizing the Master Report

The definition generated by Studio's Master Report Layout wizard includes a number of elements that you can customize.

For example, in the header you can specify your own logo image and title. You can copy and paste Menu Branch and Menu Leaf elements as often as needed to complete your menu. And you can place your own message in the footer.

Of course, you're not limited to working with just the elements and styling that the wizard generates - you can tailor the definition to meet your needs.
 

Using Tokens in a Master Report

Due to the way that the Logi Server Engine combines a Master Report definition and the other report definition, you can include certain tokens in the Master Report representing data from the other report.

For example, if the other report is called with a URL that includes Request variables, then you can access those values using @Request tokens in the Master Report definition. As such, there's no way to, nor need to, use elements to "pass" parameters to the Master Report.

Similarly, if the other report uses Local Data to retrieve data, then you can use @Local tokens to access those values in the Master Report definition.

Tokens with universal scope, like @Session, @Function, @Constant, and others, can also be used in the Master Report definition and will be evaluated properly.
 

Styling a Master Report

If you want to use a theme with your application we generally recommend that you apply it in your application's _Settings definition or in the other reports, not in a Master Report. If a Master Report and the other report definition are assigned different standard themes, the other report's theme will be used.

You can include a style sheet in a Master Report to style it, but be aware that the styling is not restricted to the Master Report. Due to the way the definitions are combined at runtime, unless overridden by a class in a theme assigned to the other report, classes in the Master Report could affect content in the other report.
 

Other Considerations

You may use User Input elements in a Master Report and their values will be passed as Request variables, as usual, when the combined reports are submitted.

Master Reports are executed every time another report that references them is loaded or re-loaded so, for best performance, you probably do not want to place long-running queries in them.

Back to top