Determines whether a report is currently set up to use a custom Word layout or RDLC layout at run time.
HasCustomLayout(ObjectType : 'Report'; ObjectID : Integer) : Integer |
Parameters
- ObjectType
- Type: Option The Microsoft Dynamics NAV object type that is run. Currently only the Report value is supported.
- ObjectID
- Type: Integer The ID of the Microsoft Dynamics NAV report object.
Return Value
-
Type: Integer
The following values are available.
Value Description 0
The report is not currently set up to use a custom RDLC or Word layout.
1
The report is currently set up to use a custom RDLC layout.
2
The report is currently set up to use a custom Word layout.
Applies To
Report layout implementation in codeunit 1 ApplicationManagement.
Remarks
This function is executed when a report is run from the Microsoft Dynamics NAV client or by a call to the Run, SaveAsWord, SaveAsPdf, and SaveAsExcel functions. The HasCustomLayout function is executed at run time before the OnPreReport Trigger.
Example
The following example shows the default implementation on the function in codeunit 1. This example uses a variable ReportLayout that has the data type Record and subtype Report Layout.
Copy Code | |
---|---|
IF ObjectType <> ObjectType::Report THEN ERROR(NotSupportedErr); IF ReportLayout.GetActiveReportLayout(ObjectID,ReportLayout.Type::RDLC) THEN EXIT(1); IF ReportLayout.GetActiveReportLayout(ObjectID,ReportLayout.Type::Word) THEN EXIT(2); EXIT(0); |