预订演示
前页 后页

DocumentGenerator Class

The DocumentGenerator Class provides an interface to the document and web reporting facilities, which you can use to generate reports on specific Packages, diagrams and elements in your model. This Class is accessed from the Repository Class using the CreateDocumentGenerator() method.

DocumentGenerator Attributes

Attribute

Remarks

See also

ObjectType

ObjectType

Notes: Read only

Distinguishes objects referenced through a Dispatch interface.

ObjectType

DocumentGenerator Methods

Method

Remarks

See also

DocumentConnector (long connectorID, long nDepth, string templateName)

Boolean

Notes: Documents a connector.

Parameters:

  • connectorId: Long - the ID of the connector
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - the name of a template to use when documenting connectors; this can be blank

DocumentCustomData (string XML, long nDepth, string templateName)

Boolean

Notes: Documents information based on the data supplied.

Parameters:

  • XML: String - the XML of the data to be documented
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - the name of a template to use when documenting custom data; this can be blank
Example Template Fragment Script

DocumentDiagram (long diagramID, long nDepth, string templateName)

Boolean

Notes: Documents a diagram.

Parameters:

  • diagramId: Long - the ID of the diagram
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - the name of a template to use when documenting diagrams; this can be blank

DocumentElement (long elementID, long nDepth, string templateName)

Boolean

Notes: Documents an element.

Parameters:

  • elementId: Long - the ID of the element
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - the name of a template to use when documenting elements; this can be blank

DocumentModelAuthor (string name, long nDepth, string templateName)

Boolean

Notes: Documents a model author.

Parameters:

  • name: String - the name of the author
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model authors; this can be blank

DocumentModelClient (string name, long nDepth, string templateName)

Boolean

Notes: Documents a single model client.

Parameters:

  • name: String - the name of the client
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model clients; this can be blank

DocumentModelGlossary (long id, long nDepth, string templateName)

Boolean

Notes: Documents a single model glossary term.

Parameters:

  • id: Long - the ID of the term
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model glossary terms; this can be blank

DocumentModelIssue (long id, long nDepth, string templateName)

Boolean

Notes: Documents a single model issue.

Parameters:

  • id: Long - the ID of the issue
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model issues; this can be blank

DocumentModelResource (string name, long nDepth, string templateName)

Boolean

Notes: Documents a single model resource.

Parameters:

  • name: String - the name of the resource
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model resources; this can be blank

DocumentModelRole (string name, long nDepth, string templateName)

Boolean

Notes: Documents a single model role.

Parameters:

  • name: String - the name of the role
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model roles; this can be blank

DocumentModelTask (long id, long nDepth, string templateName)

Boolean

Notes: Documents a single model task.

Parameters:

  • id: Long - the ID of the task
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting model tasks; this can be blank

DocumentPackage (long packageID,
long nDepth,
string templateName)

Boolean

Notes: Documents a Package.

Parameters:

  • packageId: Long - the ID of the Package
  • nDepth: Long - the depth by which to adjust the heading level
  • templateName: String - a template to use when documenting Packages; this can be blank

GetDocumentAsRTF()

Read Only.

Returns a string value of the document in raw Rich Text Format.

GetProjectConstant (string nameVal)

String

Notes: Returns the value of a Project Constant.

Parameters:

  • nameVal: String - the name of the Project Constant for which to extract the value.
Project Constants

GetLastError ()

String

Notes: Returns a string value describing the most recent error that occurred in relation to this object.

InsertBreak (long breakType)

Boolean

Notes: Inserts a break into the report at the current location.

Parameters:

  • breakType: Long - 0 = page break, 1 = section break
DocumentBreak

InsertCoverPageDocument (string Name)

Boolean

Notes: Inserts the Coverpage into the document at the current location.

The style sheet is applied to the document before it is insert into the generated document.

Parameters:

  • Name: String - the name of the Cover page document found in the Resource tree

InsertHyperlink (string Name, string URL)

Boolean

Notes: Inserts a hyperlink at the current location. If you use a URL with the  #BOOKMARKNAME syntax, the hyperlink will link to another part of the document.

Parameters:

  • Name: String - the link text to insert into the report
  • URL: String - The URL of the website to link to

InsertLinkedDocument (string guid)

Boolean

Notes: Inserts a Linked Document into the report at the current location.

A Linked Document can used to set the header and footer of the report. These are taken from the first Linked Document added to the report.

Parameters:

  • guid: String - the GUID of the element that has a Linked Document

InsertTableOfContents

Boolean

Notes: Inserts a Table of Contents at the current position.

InsertTeamReviewPost (string path)

Boolean

Notes: Inserts a Model Library posting into the report at the current location.

Parameters:

  • path: String - the path of the Model Library post

InsertTemplate (string templateName)

Notes: Inserts the contents of the template directly into the report.

Parameters:

  • templateName: String - the name of the template to use

InsertText (string text,
string style)

Boolean

Notes: Inserts static text into the report at the current location.

A carriage return is not included; if you need to use one, you can add it manually.

Parameters:

  • text: String - the static text to be inserted
  • style: String - the name of the style in the template; defaults to Normal style

InsertTOCDocument (string name)

Boolean

Notes: Inserts the Table of Contents into the document at the current location.

Note: The stylesheet is applied to the document before it is insert into the generated document.

Parameters:

  • name: String - the name of the Table of Contents document found in the Resource tree

LoadDocument(string FileName)

Boolean

Notes: Inserts an external document into the currently generated file.

Parameters:

  • FileName: String - the filename of an external document file to insert into the document.

NewDocument (string templateName)

Boolean

Notes: Starts a new document; you call this before attempting to document anything else.

Parameters:

  • templateName: String - the name of a template to use when documenting elements; this can be blank

ReplaceField (string fieldname,
string fieldvalue)

Boolean

Notes: Replaces the 'Section' field identified by the fieldname parameter with the value provided in fieldvalue. For example:

     ReplaceField ("Element.Alias", "MyAlias")

If you call this function more than once with the same fieldname, the field only has the most recent value set.

Parameters:

  • fieldname: String - the field name to find (this does not include the {} braces)
  • fieldvalue: String - the value to insert into the field; this can be a constant or a derived value

SaveDocument (string filename,
long nDocType)

Boolean

Notes: Saves the document to disk.

Parameters:

  • filename: String - the filename to save the file to
  • nDocType: Long - 0 = RTF, 1 = HTML, 2 = PDF,
    3 = DOCX
DocumentType

SetPageOrientation (long pageOrientation)

Boolean

Notes: Sets the current page orientation.

Parameters:

  • pageOrientation: Long - 0 = Portrait, 1 = Landscape
DocumentPageOrientation

SetProjectConstant (string newNameVal, string newValue)

Boolean

Notes: Sets a Project Constant for the documentation generator; this is saved in the current model.

Parameters:

  • newNameVal: String - the name of the Project Constant
  • newValue: String - the value of the Project Constant
Project Constants

SetStyleSheetDocument (string name)

Boolean

Notes: Sets the Stylesheet to be used for TOC, Coverpage and templates used. This can be called before NewDocument.

Parameters:

  • name: String - the name of the stylesheet found in the Resource tree

SetSuppressProfile (name)

Boolean

Notes: Sets the Suppress Profile to be used during report generation.

Parameters:

  • Name: String - The name of the Suppress Profile, as created on the 'Suppress Sections' tab of the 'Document Generation' dialog.
Suppress Sections

Learn more