Home > Class Reference > ENSLIB namespace > %SYS.PTools.FileCreation

%SYS.PTools.FileCreation

abstract class %SYS.PTools.FileCreation

This class is a place to create File Creation & Formatting methods used by the PTools Application Package, which was designed to gather performance statistics for any type of Routine, Code Block or SQL Statement. The following methods are written to be used within Class Definitions, and the equivalent methods within the %SYS.PTools.FileCreation.INC file are written to be used within MAC Routines and are written as pure COS methods. The file formatted that these methods support are driven by the 'format' parameter and support the following formats: format - The output format of the Export/Reporting file This parameter has the following structure of constituent elements: format=[:$LB(,,)] Where the constituent elements have the following values: - The format of the Export/Reporting file: - P = Printable/Viewable report file (.txt file, no pagination) - D = Comma-delimited data file (.csv file) which can be read into a spreadsheet - X = Microsoft Excel XML markup file suitable for import into Excel (.xml file) - H = HTML page file (.html file) - Z = User-defined delimiter "P" formatted file (.dlm file) NOTE: The element is required or defaulted to $C(9) (TAB) Optional Elements: - User-defined delimiter [DEFAULT: $C(9) (TAB)] NOTE: This is generally used for ="Z" - .csv file header for ="D": - 0 = Don't add non-standard information header to file [DEFAULT] - 1 = Add non-standard information header to file - .csv file footer for ="D": - 0 = Don't add non-standard information footer to file [DEFAULT] - 1 = Add non-standard information footer to file EXAMPLES: Valid 'format' values: - "H" // HTML file - "D" // CSV file with No information header or footer - "D:"_$LB(,1,1) // CSV file with information header & footer - "Z:"_$LB("^") // User-defined delimiter file (delim="^") This class is Super-Class, and is used as part of the EXTENDS directive for the following classes: - %SYS.PTools.SQLQuery - %SYS.PTools.Stats - %SYS.PTools.StatsSQL - %SYS.PTools.SQLStats

Method Inventory

Methods

classmethod CSVtabHead(metadata, delim) [ Language = objectscript ]
CSV Table Header
classmethod CSVtabRow(metadata, delim) [ Language = objectscript ]
CSV Table Data Row
classmethod DLMtabHead(metadata, delim) [ Language = objectscript ]
DLM Table Header
classmethod DLMtabRow(metadata, delim) [ Language = objectscript ]
DLM Table Data Row
classmethod HTMLtabHead(aTag, title, metadata) [ Language = objectscript ]
HTML Table Header
classmethod HTMLtabRow(metadata) [ Language = objectscript ]
HTML Table Row
classmethod TXTtabHead(metadata, delim) [ Language = objectscript ]
Text Table Header
classmethod TXTtabRow(metadata, delim) [ Language = objectscript ]
Text Table Data Row
classmethod XMLcolAuto() [ Language = objectscript ]
XML Column AutoFit Width Element
classmethod XMLcolWidth(width) [ Language = objectscript ]
XML Column Width Element
classmethod XMLrowHeader(metadata) [ Language = objectscript ]
XML Header Row Element
classmethod XMLsheet(name) [ Language = objectscript ]
XML Worksheet Element
classmethod XMLsort(sortColList, sortOrderList) [ Language = objectscript ]
XML Sorting Element
classmethod XMLtabRow(metadata) [ Language = objectscript ]
XML Table Data Row Element
classmethod XMLtable(colCnt=0, rowCnt=0) [ Language = objectscript ]
XML Table Element
classmethod condsMatch(conds, d, condValExp="") as %Status [ Language = objectscript ]
Check Conditional Matches
classmethod createAndOpenFile(file, timeout=$$$PTSOpenTimeout) as %Status [ Language = objectscript ]
Create & Open File
classmethod createOrderByList(orderBy="", d) as %String [ Language = objectscript ]
Create a valid SQL
classmethod fileBody(file, format, metadata) [ Language = objectscript ]
File Body
classmethod fileFooter(file, format, footerMsg, metadata, elapseTime, rowCnt) as %Status [ Language = objectscript ]
File Footer
classmethod fileHeader(file, format, title="", class, method, version, metadata, bcFlag="") as %Status [ Language = objectscript ]
File Header
classmethod getOutputFile(file="", className="", methodName="", format="", hDate="", tSC=$$$OK) as %String [ Language = objectscript ]
Get the 'outputFile'
classmethod openFileForRead(file, timeout=$$$PTSOpenTimeout) as %Status [ Language = objectscript ]
Open File For Read

Subclasses