Calling reports from workflow formulas

Because you are using a formula to generate a report, you can call the formula from any workflow event in the system.

The Run Report snippet in the Formula Editor provides an example of how you can run a formula report from the AfterUpdate event of the BuildingApplication object.

Dim result as Result = Result.Success  
 
Dim reportRequest = new Hansen.Core.Report.Management.ReportRequest()
 
'Name of the other report in Reports Manager under General Reports
reportRequest.Name = "CustomReport"
reportRequest.ExportType = "pdf"
 
'Component Parameter in the report setup in Reports Manager under General Reports
reportRequest.Parameters.Add("ApplicationKey", oBuildingApplication.BuildingApplicationKey)
 
Dim reportService = ServerApplication.Resolve
     (Of Hansen.Core.Report.Management.IReportManagementService)
Dim reportResponse As Hansen.Core.Report.Management.ReportResponse = 
     reportService.Generate(reportRequest)
 
'You can use this stream to send it other places such as FileManager, Notifications or EDMS.
Dim outputStream = reportResponse.OutputStream
 
Return result