Book a Demo

Author Topic: Doc Gen Stylesheets  (Read 8047 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Doc Gen Stylesheets
« on: December 05, 2015, 02:16:40 am »
Hi All

I may be getting dumb, but I just cannot get the stylesheets in the doc gen to work.

I have created my own stylesheet.
I have created a simple template.
I have generated a document use my template and selected my stylesheet

Nothing, the styles are exactly as defined in the standard template no style overrides.

The help states:

[highlight]A user can choose to apply a Stylesheet to any kind of document report they are generating, in which case the styles in the Stylesheet override the styles with matching names in the template or Normal.rtf[/highlight][/b]

Certainly the names of the styles in my stylesheet ,match those in Normal.rtf, and I have modified them all.

I have used Geerts excellent blog at http://bellekens.com/2015/11/12/tutorial-generate-complex-documents-from-enterprise-architect-with-a-two-step-semi-automated-approach/

I noticed in Geert's example, the styles appear to have been imported into all the templates, but I just can see a method for doing this, or even if this is necessary.

I have seen the menu option File > Update Styles, but only the normal.rtf and the Sparx Styles are listed, mine is not there.

Yes I am probably being dumb, but how can you get stylesheets to work?

Using the latest version of EA version 12.1 and Word 2013

Cheers

Phil
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Doc Gen Stylesheets
« Reply #1 on: December 05, 2015, 03:52:17 am »
Phil,

If your stylesheet is available in the resources it should show up in the update styles command.

Have you tried with my hotellio.eap file?

The stylesheet I defined there is available in the update styles command.

Furthermore it is indeed not necessary to update the styles in each template. I did so because that is easier when designing the template, but if you apply another style sheet when generating the document that should work as well.

The only thing I found that sometimes didn't work was the "normal" style. For some reason it sometimes gets overwritten by something else.
I now simply don't use "normal" anymore, but use "my normal" or something similar.

Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Doc Gen Stylesheets
« Reply #2 on: December 08, 2015, 09:50:11 pm »
Many thanks for your pointers.

The main issue I had was that I did not create the stylesheet properly in the first place!

I have now discovered the right way to set the styles, not at all intuitive, but then again this is EA!

Usually I can work things out without resorting to the help, but in this case I had to dig around and eventually came up with the solution.

It now works perfectly and elegantly.

Cheers

Phil
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Doc Gen Stylesheets
« Reply #3 on: December 08, 2015, 11:27:27 pm »
Yes I know, editing styles is a nightmare.
I'm guessing it is not specific to EA but due to the RTF editor component they use.

I hope they have a replacement for that wacky thing somewhere in the pipeline.
Nowadays with OpenXML being an ISO standard, there isn't much excuse for still holding on to the ancient RTF format anymore.

But it it's true, once you have managed to make a decent stylesheet (aarhg numbered lists :-X) you don't often have to touch it again and it does its job.

Geert

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: Doc Gen Stylesheets
« Reply #4 on: December 09, 2015, 12:44:19 am »
You do know there's a simpler answer to all this, don't you?  ;)
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Doc Gen Stylesheets
« Reply #5 on: December 09, 2015, 11:27:40 am »
Quote
You do know there's a simpler answer to all this, don't you?  ;)

Perhaps more complete, rather than simpler.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Doc Gen Stylesheets
« Reply #6 on: December 09, 2015, 10:19:44 pm »
Quote
You do know there's a simpler answer to all this, don't you?  ;)

Absolutely, however I need to be able to utilise both methods, depending upon a client's needs ;)

Models are great!
Correct models are even greater!

Mr. Sanders

  • EA User
  • **
  • Posts: 187
  • Karma: +0/-0
  • Dilbert for president
    • View Profile
Re: Doc Gen Stylesheets
« Reply #7 on: December 10, 2015, 12:48:48 am »
Hello Phil,

so what was the Problem that you didn't create the style Sheets properly?

I have the same issue.
I am clicking around for hours to get the style Sheets applied.
No way.


philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Doc Gen Stylesheets
« Reply #8 on: December 10, 2015, 08:06:38 pm »
Hi

Not so easy to explain in  words but I intent to create a tutorial on Stylesheets for the Sparx Community site, but in the meantime.

1) Open your stylesheet
2) Create some text
3) Write-click and select Edit > Edit styles... from the menu
4) Select the style you wish to change in the list displayed in the dialog, or you can create your own style name
5) Click OK, this starts a "recording"
6) Using the styles toolbar, select the same style as you are changing, select the font, size, colour etc
7) When finished click anywhere in the stylesheet to "stop the recording"

Repeat for all styles that you wish to modify.

Save the stylesheet.

Now it should work.

Cheers

Phil
Models are great!
Correct models are even greater!