Manuais
PHC GO Funções SDK - Analytics
 

Analytics

This class contains methods and functions related to analytics.
 
 

SendAnalyticsRecords


Description

Sends analytics record by e-mail .

Return Function

PHCResult.

Parameters


Name Description Type
analysisNumber Analysis internal number Decimal
fileFormat String that indicates the format of the file that will be generated (PDF or XLSX) String
vars List of analysis variables List(Of VarsVO)
recordStamp If it is a record analysis, it must contain the record stamp String
emailFrom The email account for sending email String
emailTo The email account for email receiver String
emailSubject Email subject String
emailBody Email body. This parameter is optional and the default value is Nothing. String
emailCc The email account for email cc receiver.This parameter is optional and the default value is Nothing. String
emailBcc The email account for email bcc receiver.This parameter is optional and the default value is Nothing. String
Orientation The orientation of the PDF file. This parameter is optional and the default value is 1. The values available are: 1 - Automatic; 2 - Vertical; 3 - Horizontal. Integer

Example


'This example sends  by email a list of internal documents created for a particular customer in the current year (analysis 129) 
Dim customerStamp as String = "81c-4fa9-bf9b-d1346eb11eb" 'Customer stamp
Dim analysisNumber as Decimal = 129

Dim myVars = New List(Of VarsVO)()


myVars.Add(New VarsVO() with {.no = 1, .tipo = "D", .vdate = New DateTime(Year(Date.Now), 1, 1)})
myVars.Add(New VarsVO() with {.no = 2, .tipo = "D", .vdate = Date.Now})
Dim result as PHCResult = SDK.Analytics.SendAnalyticsRecords(analysisNumber, "PDF", myVars, customerStamp, "from@phcsoftware.com", "to@phcsoftware.com", "Internal documents - Year " & Year(Date.Now)


GenerateAnalyticsRecords


Description

Generates analytics record file into application´s export directory.

Return Function

PHCResult.

Parameters


Name Description Type
analysisNumber Analysis internal number Decimal
fileFormat String that indicates the format of the file that will be generated (PDF or XLSX) String
vars List of analysis variables List(Of VarsVO)
recordStamp If it is a record analysis, it must contain the record stamp String
Orientation The orientation of the PDF file. This parameter is optional and the default value is 1. The values available are: 1 - Automatic; 2 - Vertical; 3 - Horizontal. Integer

Example


'This exemple attachs the result of analysis 129 into client table 

Dim customerStamp as String = "81c-4fa9-bf9b-d1346eb11eb" 'Customer stamp

Dim analysisNumber as Decimal = 129

Dim myVars = New List(Of VarsVO)()

myVars.Add(New VarsVO() with {.no = 1, .tipo = "D", .vdate = New DateTime(2021, 1, 1)})

myVars.Add(New VarsVO() with {.no = 2, .tipo = "D", .vdate = New DateTime(2021, 12, 31)})

Dim result as PHCResult = SDK.Analytics.GenerateAnalyticsRecords(analysisNumber, "PDF", myVars, customerStamp)

If Not result.HasMsgErrors

Dim completeFilename As String = result.result.Cast(Of StringVO).FirstOrDefault.phcString

Dim filename As String = completeFilename.Split("/"c)(1)

sdk.FileUtil.createBDAttachment(filename,"List of dossiers from year 2021","","CL", 0, customerStamp)

End if