Author Topic: A3 - A4 - Portrait - Landscape - Doc generation  (Read 4398 times)

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
A3 - A4 - Portrait - Landscape - Doc generation
« on: June 19, 2015, 11:29:07 pm »
Hello folks,

I am trying to generate some docs but i got stuck on a "minor" problem.

When I generate a diagram it's inserted in a A4 portrait page (that is coming from the fact that my template is A4 portrait).

[size=16]BUT[/size]

I have defined in the diagram properties A3 landscape(see below)!


Is there a way to get the diagram inserted the way it is defined in diagram properties?

The diagram could be in:
  • A4 portrait
  • A4 landscape
  • A3 portrait
  • A3 landscape

Do i have to define 4 different templates?

Where is defined A4 and A3? (i found portrait/landscape is defined in theDiagram.Orientation = "L"/"P" but nothing about A4/A3...)

Thank you for your help!
« Last Edit: June 19, 2015, 11:29:30 pm by damien.reche »

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #1 on: June 25, 2015, 07:22:41 pm »
Hello,

Found out how to manage Portrait or Landscape.
I use docGenerator.SetPageOrientation(0) or docGenerator.SetPageOrientation(1)
It works.

BUT

still have a problem on [size=14]HOW TO MIX A4 and A3.[/size]
something like docGenerator.SetPageSize(A3)??
or how to lunch a word macro from ea? that could work...

Thanks
« Last Edit: June 25, 2015, 07:25:35 pm by damien.reche »

Sunshine

  • EA User
  • **
  • Posts: 686
  • Karma: +46/-3
  • Emoji's make you look younger
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #2 on: June 25, 2015, 07:45:55 pm »
To mix A4 and A3 in a single doc you need to add sections breaks. So the pattern I use is to create a template for each size and orientation and add a section break in each template.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #3 on: June 25, 2015, 07:52:22 pm »
Quote
To mix A4 and A3 in a single doc you need to add sections breaks. So the pattern I use is to create a template for each size and orientation and add a section break in each template.

Thanks sunshine for an answer.

Thats what i did..
Right click > Insert > Section break
Right click > file > printer setup > A3

But, that change All my pages to A3 on my template.
and that is not working on my model using scripting and the document generator class of EA (result is still in A4 no matter what).

Is there, by any mean, the possibility for you to give me an eap or a detailed way to do this?
« Last Edit: June 25, 2015, 09:41:01 pm by damien.reche »

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #4 on: June 29, 2015, 05:48:12 pm »
UP!

I still don't have a way to mix A4 and A3 using document generator class on EA 11.1...

Sunshine

  • EA User
  • **
  • Posts: 686
  • Karma: +46/-3
  • Emoji's make you look younger
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #5 on: July 01, 2015, 07:05:43 am »
If you are struggling getting this working with the built in editor try exporting to RTF and edit in MS Word then import.  Think that's how I managed to get it to work now I think about it a bit more.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #6 on: July 01, 2015, 05:53:28 pm »
Quote
If you are struggling getting this working with the built in editor try exporting to RTF and edit in MS Word then import.  Think that's how I managed to get it to work now I think about it a bit more.

what do you mean by import?
+
my templates within EA are correctly (mixed) in A3 and A4
but using the document generator class, it only size my diagrams to A3 but do not define the page as A3 (well it keeps the size definied when i use Newdocument() ).
I tried by defining printer setup as A3 in a template --> KO
edit section style A3 in a template --> KO

 >:( >:( >:( >:( >:( >:(

EDIT :

I tried using F8 + generating my template.
All goes normaly (A4/A3 mixed).
So the problem seems to be that the document generator class does not work the same way as the generator.
For example :
Code: [Select]
docGenerator.NewDocument("Normal A4") ;
docGenerator.InsertText ("STUFF", "heading")
docGenerator.DocumentDiagram(theDiagram.DiagramID,level, "A3 Diagram Landscape");
Will not insert fully the template. It will only treat the object (here diagram) as in the defined template(a3) and past it in the destination document(a4) (a3 img in a a4 document).

If someone can confirm that.

That is a real issue since i can't get the same order of generation using only templates (that i do with scripting) since EA manage object using Breadth First Search tan i want to use a Depth First Search method.

If anyone has a solution that will allow me to use A4 and A3 using the document generator class, i appreciate.

I know that this is possible using the F8 solution but that will not comply with the work i am tring to do.

THANKS



« Last Edit: July 01, 2015, 10:52:15 pm by damien.reche »

Sunshine

  • EA User
  • **
  • Posts: 686
  • Karma: +46/-3
  • Emoji's make you look younger
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #7 on: July 03, 2015, 12:16:03 pm »
Thought you were having problems setting the template to mix A4 and A3 and struggling to use the template editor. So I suggested exporting the template to RTF changing it in MS word then importing. You can do this by opening the template and using the menu File>Import or Export.

Not sure what you doing now with the API with doc generator class as you haven't explained so can't help.

All I know is I can generated 100% documents from Sparx EA with A4 and A3 with mix of landscape and portrait without any issues. But I'm using virtual documents and templates and the Sparx EA UI not the API.


Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #8 on: July 03, 2015, 05:24:28 pm »
Quote
Not sure what you doing now with the API with doc generator class as you haven't explained so can't help.

Code: [Select]
docGenerator.NewDocument("Normal A4") ;
docGenerator.InsertText ("STUFF", "heading")
docGenerator.DocumentDiagram(theDiagram.DiagramID,level, "A3 Diagram Landscape");

Quote
All I know is I can generated 100% documents from Sparx EA with A4 and A3 with mix of landscape and portrait without any issues. But I'm using virtual documents and templates and the Sparx EA UI not the API.
Yes but i am not sure the classic UI allow us to generate a document that goes:
Diagram (lvl1) >activites (if composite) > Composite diagrams (lvl2) > activites (if composite) > Composite diagrams (lvl3) > activites (if composite) >Composite diagrams (lvl4)> activites (if composite) > ....
And do not run by packages.

Thats why i use scripting =)

The only problem come from if you use NewDocument("Normal A4").
I never get the possibility to set the paper size to A3. Only to insert A3 formatted contend in a A4 page.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8484
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #9 on: July 04, 2015, 03:29:07 pm »
Quote
Yes but i am not sure the classic UI allow us to generate a document that goes:
Diagram (lvl1) >activites (if composite) > Composite diagrams (lvl2) > activites (if composite) > Composite diagrams (lvl3) > activites (if composite) >Composite diagrams (lvl4)> activites (if composite) > ....
And do not run by packages.

Thats why i use scripting =)
Actually it does, if you use virtual documents.
I faced a similar issue at a client. They wanted EA to generate the documents exactly as they had been defined before (without knowledge of the future model structure).
It needed information from all over the model using different links, queries etc..

My solution was to make a script that builds the virtual document and its model documents.

One of the advantages is that, in theory the users can do this manually as well. Once script has been run they can edit the virtual document, removing or re-ordering things as they seem fit, and then use the standard document generation features to generate the document.

I must say that I'm pretty happy with the results. The documents look exactly as the client wanted them.

Geert


« Last Edit: July 04, 2015, 03:29:27 pm by Geert.Bellekens »

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #10 on: July 06, 2015, 05:55:26 pm »
That's sounds pretty complex and awesome!
Have you planned a demo/webinar of this script/feature?
« Last Edit: July 06, 2015, 05:55:43 pm by damien.reche »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8484
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: A3 - A4 - Portrait - Landscape - Doc generatio
« Reply #11 on: July 06, 2015, 07:27:01 pm »
The client for which I'm doing this will be doing a presentation at the EA User Group event in Brussels at September 18, 2015.

If you come to the event I'll be happy to show you how I did it

Geert
« Last Edit: July 06, 2015, 07:42:25 pm by Geert.Bellekens »

BruceTOGAF2

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generation
« Reply #12 on: October 05, 2017, 06:42:44 pm »
Hi Geert, When using the EA.DocumentGenerator class to save an RTF file containing a string, what determines the default font in the RTF file? How can I make the default font Calibri 12? Does this point to an RTF Fragment, RTF Template of RTF Style?

Please explain ‘Normal’  in docGenerator.InsertText(Object_Text, "Normal"); I have tried creating my own RTF fragment ‘Calb_12’ containing codes for Font Calibri 12, but this is not being used by  docGenerator.InsertText(Object_Text, "Calib_12");.

Please explain the "" parameter in  docGenerator.NewDocument(""). Is this an opportunity to define an RTF Template?

Uffe

  • EA Practitioner
  • ***
  • Posts: 1274
  • Karma: +93/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: A3 - A4 - Portrait - Landscape - Doc generation
« Reply #13 on: October 05, 2017, 07:53:36 pm »
Please post new topics in new threads. This one is two years old.

If you wish to get in touch with a specific individual, please use the PM feature.
My theories are always correct, just apply them to the right reality.