Manuais
PHC GO Funções SDK - Report
 

Report

This class contains methods and functions related to translations within the application.
 
 

GenerateReport


Description

Generates a pdf file report.

Return Function

PHCResult

Parameters


Name Description Type
entityname The name of the entity, for example Clients is CL, Invoicing Documents is FT, Suppliers is FL, Purchases is FO String
reportstamp The report stamp String
recordstamp The record stamp String
docid Entity document type (series) Integer
serie Document issue.
This parameter is optional and its default value is ReportSeries.ALL
ENUM PHCBusinessLayer.ReportSeries

Example


'A business rule responsable for sent invoice by e-mail 

If itemVO.isSigned and not IsVoid(itemVO.ClVO.email) then
Dim baseReportStamp As String = "z202102180826521220071603" 'PHC GO Documentos Faturação
Dim result As PHCResult = SDK.Report.GenerateReport("Ft", baseReportStamp, itemVO.ftstamp, itemVO.ndoc)

If Not result.HasErrors() Then
Dim filename As String = result.result.Cast(Of StringVO).FirstOrDefault.phcString
Dim emailAttachments As New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))

Dim emailSubject = itemVO.nmdoc + " nº " + itemVO.uniqueid
Dim emailbody = "Dear customer, please see attached invoice number " + itemVO.uniqueid + ". Don’t hesitate to reach out if you have any questions."
If sdk.email.send("from@phcsoftware.com", itemVO.ClVO.email, emailSubject, emailbody, True, emailAttachments)
listMsg.Add(New MsgInfo("The invoice has been sent by e-mail to customer"))
End If
End If
End If