Using eaDocX Styles

Navigation:  Advanced Formatting > Scripted Formatting >

Using eaDocX Styles

Previous pageReturn to chapter overviewNext page

If you want your scripted output to look the same as the rest of your eaDocX-generated content, then you need to add some additional tags into your generated HTML. This makes your generated HTML use the same Word Styles as the rest of your document.

eaDocX doesn't embed the names of the Word Styles in the HTML, but uses a level of indirection to them, by creating HTML styles of its own which can use used throughout all documents, then just adds the styles into the HTML once.  This means that all yor scripts can use a single set of styles - the eaDocX ones - then users can associate those eaDocX styles with Word Styles via eaDocX 'Options and Settings' .

So, you'll need to add these HTML styles into your generated HTML.

The tags you need to add are:

eaDocX Style

Usage

Inline


xNormal

e.g. <p class="xNormal"> My Text </p>

xInlineBullet

e.g. 

<ul>

    <li class="inlineBullet"> my text </li>

   ....

</ul>

xInlineNumberedBullet

e.g. <ol>

   <li class="xInlineNumberedBullet">my text </li>

  ...

</ol>

Tables


xTableHead

 

 

(see example scripts)

xTableBody

xTableBullet

xTableNumberedBullet

Matrix Reports


xMTXHead

Matrix heading - the top row and left hand column

xMTXColumn

Heading for columns, where additional attributes are used

xMTXCell

Cells within the matrix

xMTXTitle

Heading for rows, where additional attributes are used

Inline Tables


xHinlineTableHead


xHinlineTableBody


xVinlineTableHead


xVinlineTableBody


Diagrams


xDiagramTitle


xDiagramNote


xDiagramBullet


xDiagramNumbered


 

We provide some sample scripts, on www.eateamworks.com, which you can download and try for yourself.

 

Sample File

Description

API Test

Simple script to verify that the correct parameters are being passed to the script. These parameters are:

Parameter


Repository

A reference to the current repsitory

ElementGuid

A collection of EA element GUIDs, delimited by commas, of the elements to be printed. Your script then has the choice to print them all together e.g. in a table, separately, like eaDocX 'inline', or miss-out some elements completely.

ElementType

the type of element being printed. e.g. 'Requirement', 'Actor'

HeadingLevel

The heading level to be printed. Useful when you want to add sub-headings and give them the right level to fit with the rest of the document

BulletList

Prints a set of elements as a bullet list (HTML Simple List) containing just their names, but formatted to use the style which eaDocX uses for bulleted lists.

BulletList2

Prints a slightly more complex bullet list, which looks like:

Element1 name : element1 notes

Element2 name: element2 notes

Table 1

Simple table, with one row per element. Duplicates what can do more easily using standard eaDocX 'Table' formatting, but can be modified to make more complex tables.

Table 2

More complex table, using colSpans to make sub-tables. This function isn't available in standard eaDocX

Some examples which use Word Styles

These examples how how you can additional information into your Scripts, so that the generated output looks just like the rest of the eaDocX-generated output, by adding tags which make us of Word paragraph styles.

ShowAllStyles

Shows what your output can look like when it uses Word and eaDocX styles. Has examples of all the styles are available for you to use, and how they can be applied.

BulletList_With_Styles

Just like the BulletList example above, except using the style for bullet lists from your Word document

Table_with_Styles

Like the 'Table1' example, except using word paragraph styles.

More complex Example

ImportantRequirements

Shows how a script can be used to navigate around a model, and do some calculations based on what is present. In this example, we use the numbers and types of relationships between Requirements and other Requirements, and between Requirements and Actors to work out an 'Importance' value for each requirement, then output it in a table with some simple conditional formatting.

This looks for a model like:

Requirements relate to other requirements, and to Actors, and the Actor relationships can have 'High', 'Medium' or no stereotype.

'Importance' calculation = number of related requirements +

  (3 * number of 'High' related Actors) +  (2 * number of 'Medium' related Actors) + number of (no stereotype) related actors.

This is intended as an example of the kinds of complex model navigation and calculations which will never be do-able using native eaDocX.