Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Tejo on January 22, 2013, 08:41:07 pm
-
I have defined the following template, that iterates over packages and diagrams, and should (??) output for each element contained in the diagram the element-name formatted as a heading-1:
[highlight]package >
diagram >
element >[/highlight]
1. {Element.Name} (as "Heading 1" style)
[highlight]< element
< diagram
child packages >
< child packages
< package[/highlight]
My project browser structure is as follows:
Package 1
Package 2
Diagram
Element
I would expect this to result in a piece of RTF that contains a heading-1 line with the name of Element (ie, "1. Element").
However, what is generated is a heading-3 (formatted "1.1.1 Element"). If I generate the RTF with Package 2 as root, a heading-2 (formatted "1.1 Element") is generated.
It seems that the nested depth in the hierarchy determines which heading level is generated, instead of whether I have actually included a heading line in the template or not.
What I want is that only if I define a paragraph with a Heading style, the heading level is incremented. For example, no matter which root element I choose (Package 1 or Package 2), I want a Heading-1 level for the Element, given my template and element hierarchy.
Is this possible in EA?
-
Hi,
it is possible to do that within EA.
Open your template within the document template designer
open the dialog for document options
Take "Adjust heading levels" and play around with it a little bit. In my case it is switched to Heading 9.
I hope it helps
regards
Stefan
-
..or have a look at eaDocX, which makes creating documents from EA MUCH simpler...
-
Another way to do this is to:
- create a word document with all the headings and other styles and save it as RTF.
- create a new clean template in EA
- Right click the template and select "File" -> "Import" -> <Youre RTF file>
Then EA does all things for you (also well useable for headers and footers!).
-
Thank you all for your responses.
@Sethor: The "adjust heading levels" limits the deepest allowed heading. In the example at hand this may work if I put it to 1, but if the element had sub-elements which I want as H2, this approach fails..
@Ian: Good suggestion, I have experimented with it, but have some strange behaviour about which I have posted a message on the eaDocX forum.
@marcel_str: I do not see why this would in fact generate a level-1 heading for my example...
My conclusion so far is the EA does not directly support this, which disappoints me a bit. Thanks all for your answers!
-
I have got heading levels to work OK. It is best if you start from a blank report format which you retain as your base template for all subsequent reports. Set this template up with the section headings and numbering overrides as described in the user guide (a tedious process but you have to follow it).
You do have to set the level numbering separately to the section level (right click on the section heading and select paragraph - list numbering). When you use the template it automatically recurses and so if it is outputting a sub element or package it will automatically go to the next level down
-
That's true, Robert is right. - That was the complete process which ahs to be followed. Mostly you are only doing it once and than copy the template ;)
Regards
Stefan
-
@marcel_str: I do not see why this would in fact generate a level-1 heading for my example...
I understood you want to apply some 'heading-1' style to the text in between the section markers. Am I right?
If yes:
If you import an RTF document in which all headings are fromatted the way you want, EA imports all these headings exactly like in the RTF document in your template. Then, in the RTF editor, you just select your text, set it to the heading you want, save and generate.
If no, then I don't understand what you're asking? ;)