| Id: | 21989 | 
| Product: | finPOWER Connect | 
| Type: | NEW | 
| Version: | 6.00.00 | 
| Opened: | 14/10/2024 | 
| Closed: | 13/01/2025 | 
| Released: | 17/04/2025 | 
| Job: | J034476 | 
  High Importance | 
|
  Breaking Change | 
|
Business Layer; finBL.Reports; now gives access to the entire finPOWER Connect Reporting engine
Previously, the finPOWER Connect reporting engine (ISfinReports), was not part of the main business layer and was passed separately into areas such as Report Templates and Documents that were configured to allow access to reports.
This object is now available directly from Scripts via finBL.Reports.
NOTE: Much of the functionality of finBL.Reports such as the ReportFunctions object requires references to ActiveReports (the reporting component used by finPOWER Connect). These are intentionally not added to Script which means Scripts are limited to using only a small subset of reporting functionality. This is by design.
How to use this object is outside the scope of this article but the example below, shows how a "General" type Script can create, configure and run a report:
Option Explicit OnOption Strict On' OtherPrivate mDesktopMode As BooleanPublic Function Main(parameters As ISKeyValueList) As BooleanDim FileExportPackageHandler As finwsFileExportPackageHandlerDim Report As I_ISReportBaseBLDim ReportFileName As StringDim Success As Boolean' Assume SuccessSuccess = True' InitialisemDesktopMode = (finBL.WebConfigPk = 0)' Create ReportSuccess = finBL.Reports.CreateReportForScript(isefinReportType.AccountAppList, Report)' Update ParametersIf Success Then' Calculate defaultsReport.Parameters.CalculateValues(True, False)' UpdateWith Report.ParametersEnd With' Recalculate Invisible Parameters' NOTE: This mimics how the User Interface works when a User runs a ReportReport.Parameters.CalculateValues(False, True)End If' Run ReportIf Success Then' NOTE: When running from finPOWER Connect Cloud, the Report_Progress is meaninglessfinBL.StatusProcessBegin("Running report")Main = Report.RunForScript(AddressOf Report_Progress)finBL.StatusProcessEnd()End If' Save Report to PDF' NOTE: This code will work on both desktop and in finPOWER Connect Cloud and is hence more involved than simply just saving to a PDF fileIf Success Then' Create Export PackageSuccess = finBL.HtmlWidgetUtilities.CreateProcessFileExportPackageHandler(ScriptInfo.ScriptCaption, ScriptInfo.ScriptId, FileExportPackageHandler)' Create a File Name for the PackageIf Success ThenFileExportPackageHandler.CreateFileName(String.Format("Report_{0}.pdf", finBL.TimeZoneFunctions.GetCurrentDatabaseDateTime().ToString("yyyyMMdd_HHmmss")))ReportFileName = FileExportPackageHandler.GetFullFileName(0)' Save the ReportSuccess = finBL.Reports.ReportFunctions.ExportReportToPdfForScript(Report, ReportFileName, ReportFileName)End If' Update Package StatusIf Success ThenFileExportPackageHandler.StatusUpdateInProgress(0)End If' FinaliseIf Success ThenIf FileExportPackageHandler.StatusUpdateComplete(mDesktopMode) Then' Desktop finalise has removed the "Package_" prefix from the file namesIf mDesktopMode ThenReportFileName = FileExportPackageHandler.GetShortFileName(0)End IfElseSuccess = FalseEnd IfElseIf FileExportPackageHandler IsNot Nothing ThenSuccess = FileExportPackageHandler.StatusUpdateFailed()End IfEnd If' DebugIf Success ThenfinBL.DebugPrint(ReportFileName)End IfReturn SuccessEnd FunctionPublic Sub Report_Progress(message As String,phasePercent As Double,overallPercent As Double)If overallPercent >= 0 ThenfinBL.StatusProcess(overallPercent, message)Else' A value of -1 may be passed (used internally within finPOWER Connect) so ignoreEnd IfEnd Sub
 High Importance
 Breaking Change