RadiMation Application Note 159: Difference between revisions
Line 25: | Line 25: | ||
=== Specific columns === | === Specific columns === | ||
The standard table can by default contain | The standard table can by default contain much more columns than desired. To create a clear 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 [[Chapter_13#SQL_queries_on_tables|SQL queries on tables]] section in [[Chapter 13]] of the [[Manual|{{RadiMation}} user manual]]. | ||
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. | 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. |
Revision as of 13:15, 25 July 2024
How to include nicely formatted tables in a report[edit]
This application note shows how the report generator codes in the report generator template can be modified, to automatically include nicely 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:
A simple table[edit]
When the ||TEST|EMISSION TABLE|| is used, a borderless table will be inserted in the generated report. It is inserted in Microsoft Word as a table, however it does not look very nice.
Table with border[edit]
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. The table can be formatted with the desired border width and border style, which will result in a table in the final report, that has the same border configuration. 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.
Specific columns[edit]
The standard table can by default contain much more columns than desired. To create a clear 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.
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:
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[edit]
Microsoft Word allows to use predefined table styles, to have a nice coloured table, with different header colours and alternating row colours. Any existing table style can be applied to the table that is present 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 a custom table style, or a style that is predefined in the company style guidelines.
This can for example result in:
Custom header[edit]
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.
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[edit]
Using the techniques provided in this application note, it is possible to create a report generator template that is configured to automatically generate nicely formatted tables in the final report in an automated process, without the need for the test engineer to manually modify the report.