RadiMation Application Note 159

From RadiWiki
Jump to: navigation, search

How to create a formatted table in a report

This application note demonstrates how to modify the report generator codes in the report generator template can be modified, to automatically include well-formatted tables in the final report.

In this application note it is demonstrated with the peak table of an emission test, however the same techniques can be used on any table, thus it is also applicable to the table of used equipment, the table of cables, the table of information items and any other table that can be inserted by the report generator in the report.

The formatting of the table is explained in multiple steps, where each step adds some additional formatting, and the used techniques are explained and added gradually. The steps are separated as:

  1. A simple table
  2. Table with border
  3. Specific columns
  4. Formatted table design
  5. Custom header

A simple table

When the ||TEST|EMISSION TABLE|| is used, a borderless table will be inserted in the generated report. Although it appears as a table in Microsoft Word, it lacks proper formatting.

AppNote159 SimpleTable.png

Table with border

Borders can be added to the inserted table, by including the report generator code itself in a table with the desired borders. This can be achieved by creating a table in the template, which is only 1 column wide and has a height of 1 row. The report generator code (||TEST|EMISSION TABLE||) can then be included in that single cell of the table. Format the table with the desired border width and style. The final report will reflect these border settings. While the table is inserted in the report during the generation, additional columns and rows will be added, but these will also use the border configuration of the original table from the template.

This will result in a table with a border.

AppNote159 TableWithBorder.png

Specific columns

The standard table can by default contain too many columns. To simplify the report, it can be necessary to only select a sub-set of the available columns. By using the SQL SELECT-query of the report generator, it is possible to only include a sub-set of the available columns. See the SQL queries on tables section in Chapter 13 of the RadiMation® user manual for more details.

The SQL SELECT-query is using the format: "SELECT <COLUMN-NAME-1>, <COLUMN-NAME-2> FROM <REPORT GENERATOR CODE>". The desired columns can thus be included, separated by comma's. If a column-name contains a space, the column name itself should be included in '[ ]'. Any unit that is present in the column name, doesn't need to be specified.

To only select a few columns from the ||TEST|EMISSION TABLE||, the report generator command can thus be expanded to: ||TEST|SELECT [Peak Number], Frequency, Quasi-Peak, [Quasi-Peak Limit], [Quasi-Peak Difference], Angle, Height, Polarization, Status FROM EMISSION TABLE||.

This will result in:

AppNote159 SpecificColumns.png

The order in which the column-names are specified in the SQL SELECT-query, will also be used for the order of the columns in the inserted table.

Formatted table design

Microsoft Word allows to use predefined table styles for a visually appealing table with different header colours and alternating row colours. Any existing Microsoft Word table style can be applied to the table that is specified in the report generator template. The same table style will then also be applied to the final table as it is present in the generated report.

This not only applies to the predefined table styles, but can also be used with custom table style, or a table style that is predefined in the company style guidelines.

This can for example result in:

AppNote159 FormattedTableDesign.png

Custom header

When there is a need to provide some changes in the header of the final table in the report, it is possible to provide a custom header.

The table that is inserted in the report generator table can be extended, to include a header row with multiple columns with the desired text and formatting. All the cells in the second row of that table in the template can be merged into a single cell, which includes the actual report generator code. During the generation of the report, the columns that are inserted by the report generator code will be made as wide as the already provided columns in the first row of the table.

AppNote159 CustomHeader.png

The only manual operation that should now be performed by the test-engineer is to remove the second row of the final table. At this moment this is still a manual operation and cannot be automated yet.

In the last screenshot also another last improvement is added. If the report generator code is centre aligned within the cell, also all the texts in the final table will be using that same formatting and will thus also be centre aligned.

Conclusion

By following the techniques in this application note, you can configure a report generator template to automatically produce well-formatted tables, eliminating the need for manual modifications by the test engineer.