This example uses RequisitePro.xsd Generic
XML schema, which includes the Level attribute
in the PRRequirement query.
Procedure
To create a report with heading styles applied to the FullTag:
- In the Launcher, create a document specification and configure
the data source.
- In Document Studio, open a new template.
- Add the sample data source schema:
- In the Data Source Schemas view,
click the Add Data Source Schema icon. The Data
Source Schema wizard opens and you can click Next.
- In the Schema Type field, select Generic
XML.
- Optional: Enter a custom name for the Data
Source ID.
- Click Next. Review your selections
and click Finish.
- Click Browse and select the RequisitePro.xsd sample
data file installed with the product. Default location: RPE_HOME\source\XML\examples\RequisitePro.xsd.
Click Open.
- Add elements to your template.
- Add a
Container element.
- Insert a
Paragraph element
into the container element.
- Insert a
Text element into
the paragraph element.
- Add queries to your elements.
- In the Data Source Schemas view,
expand the project and requirements.
- Drag PRRequirement into the container
element.
- Drag FullTag (string) into the
text element.
- In the Select Context window, select Use
as value.
- Select the PRRequirement container
and click OK.
- Create a style script expression for the paragraph element.
- Select the paragraph element.
- In the Properties view, select the General tab.
- In the Style name field, click
the
configuration icon.
- In the Set style name value window,
select the Script Expression tab.
- Expand Attributes and the data
source.
- Select Level.
- Enter parseInt(Level) + 1.
- Click to generate the output.
Results
As the Level values increase by
one, the heading styling increases by one as well. The Heading
1 style is set on the FullTag values
for the requirements that have 0 as the Level value.
The Heading 2 style is set on the FullTag values
for the requirements that have 1 as the Level value.
The
final output document created by the template in this example:
- Displays the FullTag values as the section
titles.
- Displays a visible hierarchy of the requirements:
- The requirements are the largest headings and use the Heading
1 style.
- The child requirements are subheadings and use the Heading
2 style.
- Creates the hierarchy on the values of the Level attribute.