email_report

Emails a report.

Path:
/lib/email_report.js

Parameters:

Name

Type

Description

Parameters

Array of Objects

An array of parameters to use in the query.

Parameters.DisplayValue

String

The display value of the parameter.

Parameters.Name

String

The name of the parameter.

Parameters.Value

String

The value of the parameter.

ReportFormat

String

The format to produce the report in. Can be set to "csv" or "html". If not specified, an Excel report named "Report.xlsx" will be generated and attached to the email.

ReportName

String

The name to assign to the report.

SelectQuery

String

The query to run for generating report data.

Subject

String

The text to use for the email subject.

To

String

The email address of the recipient.

Example Request:

POST /redrock/query

{  
   "Script":"@/lib/email_report.js",
   "Args":{  
   	  "SelectQuery": "Select ID from VaultAccount where User = \"Administrator\"",
   	  "Parameters":
   	  [
   	  	{
   	  		"Name" : "TestParam0",
   	  		"DisplayValue" : "Test0",
   	  		"Value" : "TestValue0",
   	  	}
   	  ],
   	  "To":"[email protected]",
   	  "Subject": "Test report",
   	  "ReportFormat": "html",
   	  "ReportName" : "MyReport"
   }   
}

Example Response:

"Query has failed: Parameter to may not be null or whitespace\r\nParameter name: to\r\nLine: 19 Char: 1\r\nNo source code available.",