Codeunit ReportManagement
Properties
| Name | Value |
|---|---|
| SingleInstance | True |
Methods
GetPrinterName
procedure GetPrinterName(ReportID: Integer, var PrinterName: Text[250])
Parameters
| Name | Type | Description |
|---|---|---|
| ReportID | Integer | |
| PrinterName | Text[250] |
GetPrinterSelectionsPage
[EventSubscriber(Codeunit,2616,GetPrinterSelectionsPage,,False,False)]
procedure GetPrinterSelectionsPage(var PageID: Integer, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| PageID | Integer | |
| IsHandled | Boolean |
SetupPrinters
[EventSubscriber(Codeunit,2000000005,SetupPrinters,,True,True)]
procedure SetupPrinters(var Printers: Dictionary of [Text[250], JsonObject])
Parameters
| Name | Type | Description |
|---|---|---|
| Printers | Dictionary of [Text[250], JsonObject] |
Events
OnSelectReportLayout
[IntegrationEvent(False,False)]
procedure OnSelectReportLayout(var ReportLayoutList: Record "Report Layout List", var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ReportLayoutList | Table System.Reflection."Report Layout List" | |
| Handled | Boolean |
OnAfterGetPrinterName
[IntegrationEvent(False,False)]
local procedure OnAfterGetPrinterName(ReportID: Integer, var PrinterName: Text[250], PrinterSelection: Record "Printer Selection")
Parameters
| Name | Type | Description |
|---|---|---|
| ReportID | Integer | |
| PrinterName | Text[250] | |
| PrinterSelection | Table System.Device."Printer Selection" |
OnAfterHasCustomLayout
[IntegrationEvent(False,False)]
local procedure OnAfterHasCustomLayout(ObjectType: Option, ObjectID: Integer, var LayoutType: Option)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectType | Option | |
| ObjectID | Integer | |
| LayoutType | Option |
OnAfterGetPaperTrayForReport
[IntegrationEvent(False,False)]
local procedure OnAfterGetPaperTrayForReport(ReportID: Integer, var FirstPage: Integer, var DefaultPage: Integer, var LastPage: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| ReportID | Integer | |
| FirstPage | Integer | |
| DefaultPage | Integer | |
| LastPage | Integer |
OnAfterSubstituteReport
[IntegrationEvent(False,False)]
local procedure OnAfterSubstituteReport(ReportId: Integer, RunMode: Option, RequestPageXml: Text, RecordRef: RecordRef, var NewReportId: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| ReportId | Integer | |
| RunMode | Option | |
| RequestPageXml | Text | |
| RecordRef | RecordRef | |
| NewReportId | Integer |
OnAfterDocumentPrintReady
[IntegrationEvent(False,False)]
local procedure OnAfterDocumentPrintReady(ObjectType: Option, ObjectID: Integer, ObjectPayload: JsonObject, DocumentStream: InStream, var Success: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectType | Option | |
| ObjectID | Integer | |
| ObjectPayload | JsonObject | |
| DocumentStream | InStream | |
| Success | Boolean |
OnAfterSetupPrinters
[IntegrationEvent(False,False)]
local procedure OnAfterSetupPrinters(var Printers: Dictionary of [Text[250], JsonObject])
Parameters
| Name | Type | Description |
|---|---|---|
| Printers | Dictionary of [Text[250], JsonObject] |
OnAfterIntermediateDocumentReady
[IntegrationEvent(False,False)]
local procedure OnAfterIntermediateDocumentReady(ObjectId: Integer, ObjectPayload: JsonObject, DocumentStream: InStream, var TargetStream: OutStream, var Success: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer | |
| ObjectPayload | JsonObject | |
| DocumentStream | InStream | |
| TargetStream | OutStream | |
| Success | Boolean |
OnAfterDocumentReady
[IntegrationEvent(False,False)]
local procedure OnAfterDocumentReady(ObjectId: Integer, ObjectPayload: JsonObject, DocumentStream: InStream, var TargetStream: OutStream, var Success: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer | |
| ObjectPayload | JsonObject | |
| DocumentStream | InStream | |
| TargetStream | OutStream | |
| Success | Boolean |
OnAfterDocumentDownload
[IntegrationEvent(False,False)]
local procedure OnAfterDocumentDownload(ObjectId: Integer, ObjectPayload: JsonObject, DocumentStream: InStream, var Success: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer | |
| ObjectPayload | JsonObject | |
| DocumentStream | InStream | |
| Success | Boolean |
OnCustomDocumentMergerEx
Invoke the OnCustomDocumentMergeEx trigger, which handled user defiend report renders given a dataset and a layout. The Render must be implemented in AL and return the output stream as defined by the format given in ReportAction.
[IntegrationEvent(False,False)]
local procedure OnCustomDocumentMergerEx(ObjectID: Integer, ReportAction: Option, ObjectPayload: JsonObject, var XmlData: InStream, LayoutData: InStream, var DocumentStream: OutStream, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectID | Integer | |
| ReportAction | Option |
The report action, which can be one of SaveAsPdf, SaveAsWord, SaveAsExcel, Preview, Print or SaveAsHtml. |
| ObjectPayload | JsonObject |
The JSON payload that defines metadata for the present report run. |
| XmlData | InStream |
The xml data set in an input stream |
| LayoutData | InStream |
The layout input stream. The actual format stored in the stream is defined by the layoutmodel json property (custom formats by the layoutmimetype property in the payload). |
| DocumentStream | OutStream |
Output stream that will contain the rendered output documents. |
| IsHandled | Boolean |
Will be set to true if the procedure call handled the merge. |
OnSelectReportLayoutCode
Fetch the currently selected layout code and layout type from application.
[IntegrationEvent(False,False)]
local procedure OnSelectReportLayoutCode(ObjectId: Integer, var LayoutCode: Text, var LayoutType: Option, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer |
The object id. |
| LayoutCode | Text |
The report layout code if an application override has been set for the current run. |
| LayoutType | Option |
The Layout type contained in the target stream. |
| IsHandled | Boolean |
Will be set to true if the subscriber handled the action. |
Remarks
Internal event that will be removed when the report runtime API has been updated
OnFetchReportLayoutByCode
Fetch the currently selected layout code from application.
[IntegrationEvent(False,False)]
local procedure OnFetchReportLayoutByCode(ObjectId: Integer, LayoutCode: Text, var TargetStream: OutStream, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer |
The object id. |
| LayoutCode | Text |
The report layout code if an application override has been set for the current run. |
| TargetStream | OutStream |
The layout will be written to this stream. |
| IsHandled | Boolean |
Will be set to true if the layout was found in the application database. |
Remarks
Internal event that will be removed when the report runtime API has been updated.
OnApplicationReportMergeStrategy
Obsolete
This element will become obsolete from version 26.0. Replaced by customer render and layouts must be declared as custom types.
Select between platform or application report rendering. If this trigger return InApplication = true, then run the report and layout in a custom report render using the OnCustomDocumentMergerEx event.
[Obsolete(Replaced by customer render and layouts must be declared as custom types.,26.0)]
[IntegrationEvent(False,False)]
local procedure OnApplicationReportMergeStrategy(ObjectId: Integer, LayoutCode: Text, var InApplication: Boolean, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer |
The object id. |
| LayoutCode | Text |
The report layout code if an application override has been set for the current run. |
| InApplication | Boolean |
True if the applicaction should render the report. |
| IsHandled | Boolean |
Will be set to true if the subscriber handled the action. |
OnWordDocumentMergerAppMode
Obsolete
This element will become obsolete from version 26.0. Replaced by platform Word merge with version 24
Select between platform or application report rendering for Word reports only. If this trigger return InApplication = true, then run the report and layout in the legacy OnMergeDocumentReport event.
[Obsolete(Replaced by platform Word merge with version 24,26.0)]
[IntegrationEvent(False,False)]
local procedure OnWordDocumentMergerAppMode(ObjectId: Integer, LayoutCode: Text, var InApplication: Boolean, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ObjectId | Integer |
The object id. |
| LayoutCode | Text |
The report layout code if an application override has been set for the current run. |
| InApplication | Boolean |
True if the applicaction should render the report. |
| IsHandled | Boolean |
Will be set to true if the subscriber handled the action. |
Remarks
This event is for backward compatibility only and will be depricated.
OnGetFilename
[IntegrationEvent(False,False)]
local procedure OnGetFilename(ReportID: Integer, Caption: Text[250], ObjectPayload: JsonObject, FileExtension: Text[30], ReportRecordRef: RecordRef, var Filename: Text, var Success: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ReportID | Integer | |
| Caption | Text[250] | |
| ObjectPayload | JsonObject | |
| FileExtension | Text[30] | |
| ReportRecordRef | RecordRef | |
| Filename | Text | |
| Success | Boolean |