Book a Demo

Author Topic: DocumentGenerator Related questions  (Read 2875 times)

jfm007

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
DocumentGenerator Related questions
« on: October 31, 2013, 04:23:46 pm »
Tried to write some code to do the DocumentGeneration from EA.

This is the code that I used and it is keeping giving exception

docGen.DocumentElement(element.ElementID, 0, "some template name");

Anywere I am doing wrong?

Also my question will be what is the second parameter used for

In the reference guide it has
DocumentElement (long elementID, long nDepth,  string templateName)
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

Don't really know what kind of value I should passed on the nDepth parameter.
 

jfm007

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: DocumentGenerator Related questions
« Reply #1 on: October 31, 2013, 05:22:35 pm »
Ok, the exception issue is solved, because I didn't call the NewDocument("TemplateName") before. But the problem now I am having is that,
Once I did this, the
var docGen = EADataAccess.EARepository.CreateDocumentGenerator( );
                docGen.NewDocument("xxxxx");
bool rslt = docGen.DocumentElement(element.ElementID, 6, "xxxxx");
if (rslt)
{
     docGen.SaveDocument(@"Path", DocumentType.dtRTF);
}

The saved document is empty. Is there anything else, that needs to be done?