Execute Report - Intergraph Smart 3D Web API - Customization & Programming - Hexagon PPM

Intergraph Smart 3D Web API Programmers Reference

Language
English
Product
Intergraph Smart 3D Web API
Subproduct
Smart 3D Web APIs
Search by Category
Customization & Programming
Smart 3D Version
13

ExecuteReport runs an existing Smart 3D ad-hoc report. You must provide the parameters required to run the report in the body in percentage encoded form. Smart 3D uses Smart API ExecuteReport. For more information about this, see Report execution example.

Use a single OData action and corresponding OData function to execute reports asynchronously.

  • ExecuteReport - Call this OData action to execute a report.

  • GetExecuteReportResultAsync - Call this OData function to monitor report status (relevant only if ExecuteReportAction is called asynchronously).

Refer to Asynchronous Requests to use ExecuteReport action asynchronously.

If reports do not run correctly, verify that Microsoft Excel is configured properly. Refer to topics "Configuring the Batch Services Server for Drawings Tasks" and "Configuring the Batch Services Server for Microsoft Office 365" in the Intergraph Smart 3D Installation documentation available at https://docs.hexagonppm.com.

The URL to execute report action is:

POST

https://MyServer.Domain.com/s3d/v1/Sites('MySiteAlias')/Plants('MyPlant')/Reports('{0000EAA5-0000-0000-AA2C-54C7B7541D04}')/Com.Ingr.Core.V1.ExecuteReport

Where {0000EAA5-0000-0000-AA2C-54C7B7541D04} is the OID of the report being executed. Required inputs to execute this report are accessible using the Parameters collection from a report entity using this URL.

GET

https://MyServer.Domain.com/s3d/v1/Sites('MySiteAlias')/Plants('MyPlant')/Reports('{0000EAA5-0000-0000-AA2C-54C7B7541D04}')/Parameters

An example body to execute report is in the form:

{

    "parameters": "@Id eq Value"

}

The body must be formed with the required input values following these rules:

  • In the above key-value pair, the value string must be in the form “@Id eq Value”.

    • Id - Id of the parameter. Always specify as @Id

    • eq - EqualTo operator. Always have the assignment of "eq".

    • Value - Input value to the parameter.

      For example, if a Diagnostic report has the Integrity Status as a parameter with the Id "Integrity_Status", the body is formed as follows:

      {

          "parameters": "@Integrity_Status eq 2"

      }

      In this example, 2 is a codelist value and is being passed as an input to the Integrity_Status parameter.

  • If there is more than one parameter for a given report, the input string can be extended using the “and” operator as follows:

    "@Id1 eq Value1 and @Id2 eq Value2 and …"

    For example, to run a report which asks for a PipeSpec and ApprovalStatus, the body has to be formed as follows:

    {

       "parameters": "@PipeSpec eq ‘1C0031’ and @ApprovalStatus eq 1"

    }

  • A S3dFilter Parameter Type can result in the following two cases:

    • Parametric filter - A new field FilterId is populated in the report parameter response having the GUID of filter. Annotations populate the required inputs for the filter.

    • Runtime Selection filter - The field IsRuntimeFilter on a report parameter response is set to true for these parameters. The FilterId corresponds to the default filter Id. You can choose another Filter Id.

      Build the filter parameter value as follows:

    • A JSON object must be built adhering to the “Smart API Parametric Filters Protocol”. Refer to ExecuteS3dFilter for more information on how to build the JSON object.

    • In the above built object, the Id of the filter must be inserted. Thus, add a key value pair with the key being Id and value being the filter Id.

Here is an example:

{

  "Id": "{0000272E-0000-0000-F401-B0E9B7541306}",

  "objectHierarchies": [{

   "Name": "System",

     "ResourceIds": ["Sites(‘Alias')/Plants(‘Plant’)/Systems({oid})"]

                        }

  ],

     "objectTypes": ["Com.Ingr.Smart3d.V1.Piping"],

     "queryExpression": "$filter=ApprovalStatus eq 1"

}

After the above JSON object is built, the object must be percent encoded. The percent encoding produces an encoded string which can be used as a report parameter value.

Thus, the total body is as follows:

{

"parameters": "@S3dFilter_Stairs eq ‘%7B%22Id%22%3A%22%7B0000272E-0000-0000-F401-B0E9B7541306%7D%22%2C%22objectHierarchies%22%3A%5B%7B%22Name%22%3A%22System%22%2C%22ResourceIds%22%3A%5B%22Sites%28%27defwsbindatp_sdb%27%29%2FPlants%28%27DefWSBindATP%27%29%2FSystems%28%7B00033456-0000-0000-690e-ba4dd3541d04%7D%29%22%5D%7D%5D%2C%22objectTypes%22%3A%5B%22Piping%22%5D%2C%22queryExpression%22%3A%22%24filter%3DApprovalStatus%20eq%201%22%7D’

and @PipeSpec eq ‘1C0031’

and @ApprovalStatus eq 1"

}

The percent encoding must encode space as %20. Encoding space as a plus symbol (+) is not supported.

ExecuteReport action returns the ReportResult complex type.