Sparx Systems Forum
Enterprise Architect => Bugs and Issues => Topic started by: ja1234 on July 13, 2016, 10:36:15 pm
-
Sparx version: 12.0.1214
Problem:DocumentGenerator doesn't seem to be able to generate a document based on a template.
Reproduce:
var Gentor as EA.DocumentGenerator;
Gentor = Repository.CreateDocumentGenerator();
Gentor.NewDocument("custom-reporting");
where custom-reporting is a template saved in User Templates / Templates
However, Gentor.insertTemplate("custom-reporting") works OK but will obviously insert a template and NOT generate the whole document based on a template (eg no page numbering etc)
-
Hello,
Passing an argument passed to NewDocument() doesn't mean anything gets generated at that point. No documentation is generated from a template alone.
In order to get stuff into the document you're creating, call
DocumentGenerator.DocumentElement(element.ElementID, 0, "custom-reporting");... or similar for DocumentPackage(), DocumentDiagram(), etc.
For page numbers, headers and footers, look at SetStyleSheetDocument() and InsertLinkedDocument().
HTH,
/Uffe