Book a Demo

Author Topic: Document generation  (Read 8288 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Document generation
« on: April 28, 2015, 06:46:24 pm »
Before I raise this as an issue, I would like to establish if it is at all possible.

Let's say I have a package, lets call it "Package 1" for this example, with a diagram, lets call it "Diagram 1" for this example, and a several classes, 5 for these example, "Class 1" to "Class 5".

I know the following code snippet (by the way {Element.Name} and {Element.Notes} are 2 cells on ta table

Code: [Select]
package >
{Pkg.Name}
package element >< package element
element >
{Element.Name}      {Element.Notes}
child elements >
< child elements
< element
child packages >
< child packages
< package

Is going to generate the following

Package 1

Class 1Notes for Class 1
Class 2Notes for Class 2
Class 3Notes for Class 3
Class 4Notes for Class 4
Class 5Notes for Class 5

This is good, almost what I am trying to achieve. However what I am trying to do is having a table looking like:

NameDescription
Class 1Notes for class Class 1
Class 2Notes for Class 2
Class 3Notes for Class 3
Class 4Notes for Class 4
Class 5Notes for Class 5

Is this possible? Making the top row on the table a Header Row does not do it. If it is possible, what have I missed?
« Last Edit: April 28, 2015, 06:47:08 pm by modesto.vega »

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Document generation
« Reply #1 on: April 28, 2015, 08:26:41 pm »
Yes it is possible. Just add Name and Description on first line.

i.e. adding to your example
Code: [Select]
package >
{Pkg.Name}
package element >< package element
element >
Name             Description
{Element.Name}      {Element.Notes}
child elements >
< child elements
< element
child packages >
< child packages
< package

It would also help if you added a table
« Last Edit: April 28, 2015, 08:30:41 pm by phenzell »
Happy to help
:)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Document generation
« Reply #2 on: April 28, 2015, 09:00:22 pm »
Quote
Yes it is possible. Just add Name and Description on first line.

i.e. adding to your example
Code: [Select]
package >
{Pkg.Name}
package element >< package element
element >
Name             Description
{Element.Name}      {Element.Notes}
child elements >
< child elements
< element
child packages >
< child packages
< package
It would also help if you added a table
There is table in the code, it just does not copy.

As I said in the OP, I have tried what you propose with a table and I end up with Name and Description repeated multiple times, possibly as many as elements (although I haven't counted them, there almost 200 in the model I a working with). Setting the top row as header does not solve the repetition.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Document generation
« Reply #3 on: April 29, 2015, 04:07:58 am »
Try selecting "name" and "description" cells and right click select Table -> Header Row....

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Document generation
« Reply #4 on: April 29, 2015, 05:56:19 pm »
Quote
Try selecting "name" and "description" cells and right click select Table -> Header Row....
This does not work, it repeats the headers as many time as elements.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Document generation
« Reply #5 on: April 29, 2015, 10:06:42 pm »
It does work. However there have been bugs reported against this in the past ... which version of Sparx are you using ? v8 / v9 had the bugs I think. If your using a later version ... delete the table and recreate ... it will only work if "Name", "Description" appear in cells on the first row...if there is a row above them it want work...

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Document generation
« Reply #6 on: April 29, 2015, 10:11:32 pm »
Quote
It does work. However there have been bugs reported against this in the past ... which version of Sparx are you using ? v8 / v9 had the bugs I think. If your using a later version ... delete the table and recreate ... it will only work if "Name", "Description" appear in cells on the first row...if there is a row above them it want work...
EA 12 (Build 1212). I'll try your suggestion when it gets a little quieter. I am sure I had seen this working but cannot remember if it was on 12 or 11.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation
« Reply #7 on: April 29, 2015, 10:14:07 pm »
I can confirm that it definitely works on v12.0.1213
I just created a table with headings on an rtf template and it works fine.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Document generation
« Reply #8 on: April 29, 2015, 10:17:22 pm »
Is that a build after 1212? You see I got the feeling it worked on the 1st EA12 build I downloaded (which wasn't 1212).
« Last Edit: April 29, 2015, 10:17:44 pm by modesto.vega »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation
« Reply #9 on: April 29, 2015, 10:36:59 pm »
Yes, the latest build at this moment is 1213
I don't remember seeing something about RTF tables in the release notes though.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Document generation
« Reply #10 on: May 01, 2015, 12:32:17 pm »
This used to be a problem in an early version of Sparx but thought it had been fixed years ago.
Another thing to check is the element section make sure that after your fields you don't have a newline between the last field and the closing element tag as that used to cause the problem you are seeing.
Happy to help
:)