| Python Syntax
|
Generate(<uddInputs>, <generator>, <progressMonitor>)
|
| Python Example
|
def Generate(self, input, docgen, progMon):
# Gather data from inputs
boolinput = input[0].Data()
textinput = input[1].Data()
dblinput = input[2].Data()
# Get document root
docroot = docgen.GetDocumentRoot()
# Add Section
section1 = docroot.AddSection("Summary", "Overall Results ")
# Add a table
table1 = section1.AddTable("Test Summary")
#Add a table group with 2 columns
tgroup1 = table1.AddTableGroup(2)
# get desktop application
oApp = self.GetUDDAppContext()
if oApp != None:
oDesktop = oApp.GetAppDesktop()
if oDesktop != None:
# version number
version = oDesktop.GetVersion()
text1 = tgroup1.AddContent()
text1 .Add(0, "Product Version")
text1 .Add(1, version)
oProject = oDesktop.GetActiveProject()
if oProject != None:
projectname= oProject.GetName()
text1 = tgroup1.AddContent()
text1 .Add(0, "Project")
text1 1.Add(1, projectname)
oDesign = self.GetUDDDesignContext()
if oDesign != None:
designname = oDesign.GetName()
text1 = tgroup1.AddContent()
text1 .Add(0, "Design")
text1 .Add(1, designname)
# Provides a script path
scriptpath = docgen.GetScriptPath()
text1 = tgroup1.AddContent()
text1 .Add(0, "Script Path")
text1 .Add(1, scriptpath)
#Provides the script version
text1 = tgroup1.AddContent()
text1 .Add(0, "Script Version")
text1 .Add(1, str(dblinput))
#Provides the output xml path
outputpath = docgen.GetOutputFilePath()
text1 = tgroup1.AddContent()
text1.Add(0, "Output Path")
text1.Add(1, outputpath)
#Provides the user information
text1 = tgroup1.AddContent()
text1 .Add(0, "User")
text1 .Add(1, textinput)
# Generate Xml output
docgen.Write(False)
# Generate Html output
docgen.WriteHTML()
# Generate PDF output
docgen.WritePDF()
return True
|