RadiMation Application Note 159: Difference between revisions
No edit summary |
|||
(7 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ <!-- This application note uses a report generator template that is attached to ticket: #14967 --> | ||
== How to | == How to create a formatted table in a report == | ||
This application note | 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 | 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 techniques are added gradually. The steps are separated as: | 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|A simple table]] | # [[#A simple table|A simple table]] | ||
# Table with border | # [[#Table with border|Table with border]] | ||
# Specific columns | # [[#Specific columns|Specific columns]] | ||
# Formatted table design | # [[#Formatted table design|Formatted table design]] | ||
# Custom header | # [[#Custom header|Custom header]] | ||
=== A simple table === | === A simple table === | ||
When the {{ReportGeneratorCode|TEST|EMISSION TABLE}} is used, a borderless table will be inserted in the generated report. | When the {{ReportGeneratorCode|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. | ||
[[File:AppNote159 SimpleTable.png|border]] | [[File:AppNote159 SimpleTable.png|border]] | ||
=== Table with border === | === Table with border === | ||
Borders can be added to the inserted table, by creating a table in the template, which is only 1 column wide and has a height of 1 row. The report generator code ({{ReportGeneratorCode|TEST|EMISSION TABLE}}) can then be included in that single cell of the table. | 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 ({{ReportGeneratorCode|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. | This will result in a table with a border. | ||
Line 25: | Line 25: | ||
=== Specific columns === | === Specific columns === | ||
The standard table can by default contain too | 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 [[Chapter_13#SQL_queries_on_tables|SQL queries on tables]] section in [[Chapter 13]] of the [[Manual|{{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. | 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. | ||
Line 38: | Line 38: | ||
=== Formatted table design === | === Formatted table design === | ||
Microsoft Word allows to use predefined table styles | 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 | 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: | This can for example result in: | ||
Line 58: | Line 58: | ||
== Conclusion == | == 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. | |||
[[Category:RadiMation Application Note]] | [[Category:RadiMation Application Note]] |
Latest revision as of 12:30, 29 August 2024
How to create a formatted table in a report[edit]
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:
A simple table[edit]
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.
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. 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.
Specific columns[edit]
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:
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 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:
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]
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.