In this lesson, you improve the appearance of the report
with dynamic text and formatting.
You will create a more readable report by adding information
and formatting. In the report you created, the data type information
is duplicated in the column headings and in the data rows. Also, the
table, column, and data type information is not clearly labeled. You
decide to further refine your report design by adding dynamic labels
that enable you to list and label each table by schema, and the columns
for each table are listed below the labels. This practice improves
the readability of your reports.
To format the report:
- Click the Layout tab at the bottom
of the Report Editor to open the view.
- Create dynamic text for the Column name header:
- Delete the Data Type data element
from the header row of the Columns table.
- From the Palette, drag a Dynamic
Text element into the header cell where you deleted the Data
Type data element. The Expression
Builder window opens.
- In the Expression Builder window,
add the following string to the Expression field, then click OK:
"Data type: " + row["Data Type"]
The Expression Builder window should
look like the following image:
The expression is added to the dynamic text element, as
shown in the following image:
- In the Property Editor, open the Padding tab
and change the left padding of the dynamic text element to 20.
- In the Report Editor, double-click the Name label
in the Columns table, which is found below the new dynamic label,
and change the text to Column name.
- In the Columns table, delete the Data Type label
and [Data Type] data element from the right
column. In the Report Editor, the report looks like
the following image:
- Create a dynamic text element to display the table name:
- Delete the blue Name data type
from the TableInfo detail row.
- Copy and paste the dynamic text from the Columns table
into the cell where you deleted the Name data
element.
- Click in an empty cell, then click the text in the new
cell. The Properties tab updates.
You can change the expression to dynamically fetch table names.
- In the Property Editor, click the Expressions tab.
- In Value Expression, update the
text to "Table: " + row["Name"].
- In the Property Editor, open the Padding tab and change
the left padding of the dynamic text element to 1.
- Create a dynamic label to list the source schema:
- Delete the Source Schema data
type from the TableInfo detail row.
- Copy the dynamic text that you created for the table
name and paste it into the cell where you deleted the Source
Schema data element.
- Click in an empty cell, then click the text in the new
cell. The Properties tab updates.
You can change the expression to dynamically fetch table names.
- In the Property Editor, click the Expressions tab.
- In Value Expression update the
text to "Schema: " + row["Source Schema"].
- In the Report Editor, delete the TableInfo header row that
contains the Name and Source Schema labels.
- From the Palette, drag a Label element
into the bottom footer row of the Columns table. Placing
a blank label in the footer row adds a space after the last column
name for a table. In the Report Editor, the report
layout looks like the following image:
- Preview the report. In the Report Editor, click
the Preview tab. In the Report
Editor, the report preview looks like the following image:
In the report,
there is a space between the listing of columns for each table.
You have added dynamic text that will display the list of
data objects under each table and schema. This report design makes
it easy for application developers to identify the key columns and
tables within each schema because they are conveniently sorted by
data type.
Your report design is complete. Next, you can create a report
configuration so that users can use the report design.