Book a Demo

Author Topic: Access to RTF-Template  (Read 5031 times)

MatthiasS

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Access to RTF-Template
« on: July 15, 2016, 03:42:13 pm »
Hello,

i have created a template in the Resource-Folder and placed it under Document Generation -> User Templates -> CompanyName.

Now i want to take this template and fill it with some data. Using the NewDocument (string templateName) method my C#-Call is:

              Repository repo;
         DocumentGenerator docuGenerator;
         /*
         ...
          */
         var ARCHITECTURE_DOC = "ArchitectureDoc";

         docuGenerator = repo.CreateDocumentGenerator();         
         docuGenerator.NewDocument(ARCHITECTURE_DOC);

But in docuGenerator-Object i can't find the referenced template. Where is the fault ?

Best Regards,
Matthias

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access to RTF-Template
« Reply #1 on: July 15, 2016, 05:23:10 pm »
Matthias,

Are you sure you need code to generate the document?
I'm doing pretty fancy stuff with documents, but I never felt the need to use the Document Generator API.
I can do pretty much anything I need with virtual documents (and a bit of vbscript code to automate the creation of the virtual document)

Geert

MatthiasS

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Access to RTF-Template
« Reply #2 on: July 15, 2016, 05:51:16 pm »
Hi Geert,

the idea behind this is that we have to aggregate informations from another system (Mainly project informations which are not stored in EA) via a webservice to enrich the EA-Diagrams and put it together in a standarized document.

Best Regards,
Matthias

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access to RTF-Template
« Reply #3 on: July 15, 2016, 06:12:18 pm »
I see, but still no reason to use the document generator API. Can't you use a script fragment to get the information?

I try to avoid using the document generator API in order to keep the flexibility of the virtual documents and standard RTF template generation.

Geert

MatthiasS

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Access to RTF-Template
« Reply #4 on: July 15, 2016, 09:04:08 pm »
Yes, virtual documents are a good way, but we have restrictions in creating or manipulate these documents. We just build a MDG-Plugin as a Menue-entry in EA and therefore we need the "mechanic" described above. Is there maybe an other way to create template based documents automatically?

Best regards,
Matthias