Extracting Data in Master Page

A Master Page helps you to format how page looks like (page borders, orientation, margins, color and size) and to add header and footer sections on your documents.
When designing a Master Page it might be necessary to make available data attributes in contexts where normally they would not be available.

Although data attributes cannot be used inside a Master Page element, variables can be used to hold your data. To achieve this you need to use variable assignment mechanism. So first thing to do is to create a new internal variable (internal variables are used for calculations and are not displayed in the document specification). In template editor, assign a data value to the newly created variable.
Let’s say for example that you need to display the name of a DOORS module in the header section. Add a DOORS data source schema. Create a new container in template and assign the module query on the element. Once queries are assigned to template elements, all the attributes of the elements returned by the queries can be used.

From the contextual menu of container element go to Variable Assignment option and assign to our variable the module.Name attribute.

Figure 1: Assigning Name attribute to _documentTitle variable

Now, _documentTitle variable will hold the module name.
In the Master Page, in the place where you want to display the module’s name, add a text element and set the variable as value.
The Master Page should be assigned to an element in document template and this element should be placed after the container with variable assignment.

Figure 2: Template content – container with variable assignment followed by paragraph with Master Page

This is the way that allows you to render data inside Master Pages in RPE.

One Comments to “Extracting Data in Master Page”

  1. Ranjitha says:

    It is not working for me..
    My requirement is
    I have to display component name from Rhapsody to header of the master page.

    1. I have added data source schema of Rhapsody project into my template.
    2. Created a new container in my template and assigned the component name path from data source schema.
    3. Created new variable _ComponentName from Data->New Variable option.
    4. Right clicked on Container, Data->Edit Assignment Option, Added Variable name and assigned name from data source schema.
    5. Now i tried to set “value” for my variable in Masterpage, but i could not able to see it in Masterpage. My MasterPage doesn’t have access to data source schema as this is in my template and cannot include in masterpage.

    Could you please help me to get the value in master page.

Leave a Reply