Building a custom report - Intergraph Smart Construction - 2019 (7.0) - Customization - Hexagon PPM

Intergraph Smart Construction Customization (2019)

Language
English
Product
Intergraph Smart Construction
Search by Category
Customization & Programming
Smart Construction Version
2019(7.0)

A Smart Construction Custom Report consists of several pieces.

  • A Graph Definition object

  • A View Definition object

  • A saved Adhoc Report object

  • A Smart Construction Custom Report object

  • A Report Driver (optional)

  • A Telerik Report Template

A Graph Definition, created using the SmartPlant Schema Editor, specifies the data structure (objects and relationships) required to build your custom report.

A View Definition, created from the Graph Definition created in the previous step, specifies the attributes that are presented in the report from the various object types specified in the Graph Definition.

A saved Adhoc Report object is the handle that the Smart Construction Custom Reporting Framework uses to fetch the data from the SmartPlant Foundation database. The object can be created using a load file along with the Custom Report object, and it can be created in the SmartPlant Foundation Desktop Client.

A Custom Report object ties the saved Adhoc Report object to your Telerik Report Template and driver and specifies from which context your custom report is available in the Smart Construction Client. These can be created using a load file.

The Report Driver is a class that exists in your Custom Report Library, which inherits from the class SPC.Server.Reporting.BaseReportDriver. This base class provides several overridable methods that allow you to control what happens during several steps in the Report Generation Cycle. This class builds the dataset required by your Telerik Report Template. The IReportDriver interface requires that the following methods be implemented.

The BaseReportDriver class has the following methods that can be overridden.

Overridable Sub PerformDataProcessing()

Arguments:

ByVal coreModule As SPF.Server.Modules.CoreModule

ByRef data As XmlDocument

Result:

No Result

Details:

This method allows the developer to edit the XML dataset built by the Smart Construction Custom Reporting Framework. It provides a reference to the dataset as well as a reference to the SmartPlant Foundation Server Core Module so that the developer can query against the SmartPlant Foundation database.

Sub PreReportExecute

Arguments:

ByVal coreModule As SPF.Server.Modules.CoreModule

Result:

No Result

Details:

This method allows the developer to retrieve any additional or required data for your report that is not available in SmartPlant Foundation, such as downloading view files to a temporary directory. If no additional data is required, it can be left empty.

Sub PostReportExecute

Arguments:

ByVal coreModule As SPF.Server.Modules.CoreModule

ByVal data As Xml.XmlDocument

ByRef pReportPath As String

Result:

No Result

Details:

This method is given a reference to the SmartPlant Foundation CoreModule, a reference to the dataset used in the report, and the location of the generated PDF. This method performs any post report generation tasks that need to be done. For example, this method could use AMYUNI to combine the PDF generated by the Telerik Report Template with a group of drawings that were pulled from SmartPlant Foundation in the PreReportExecute method If no additional processing or cleanup is required, it can be left empty.

Sub EnsureDataStructure()

Arguments:

ByVal data As Xml.XmlDocument

Result:

No Result

Details:

The Sub EnsureDataStructure() routine is the second method to the IReportDriver to be invoked. It includes the data that the GetReportData() generated. This function ensures the data structure. It verifies that all nodes, attributes, and relationships expected by the Telerik Report Template are present in the document.

Function GetNodeNameReplacements

Arguments:

No Arguments

Result:

A Dictionary (Of String, String)

Details:

This method allows the developer to rename nodes in the document to something that may be more meaningful to them. The XML data that is generated from SmartPlant Foundation has the schema edge names as the node names, and this functionality allows the developer to replace those edge names with a more accurate node name of the data.

Function GetLinkAttributes

Arguments:

No Arguments

Result:

NameValueCollection

Details:

This method allows the developer to specify properties located on a schema edge of a node to be included as an attribute for that node. When adding a NameValue pair to the collection, use the following:

Name = A Graph Edge name in the view definition of a report.

Value = The name of the interface definition of an edge and the name of the desired property separated by a forward slash (‘/’).

Example:

Add("SPC_ComponentItem", "ISPC_Package_ComponentItems/HangSequence")