📚 SAP Business One SDK Help

GetDefaultReportLayout Method
See Also  Example
pIReportParams
Specifies a document type, as well as a user or business partner, for which to retrieve the default report layout.

Description

Retrieves the default report layout for a specific document type.

Syntax

Visual Basic
Public Function GetDefaultReportLayout( _
   ByVal pIReportParams As ReportParams _
) As ReportLayout

Parameters

pIReportParams
Specifies a document type, as well as a user or business partner, for which to retrieve the default report layout.

Remarks

This method is similar to the GetDefaultReport method, except that this method returns the ReportLayout object for the report layout and not just the key.

Example

Getting a default report layout (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oReportLayoutService As ReportLayoutsService
Dim oReportLayout As ReportLayout
Dim oReportParam As ReportParams

'Get report layout service
oCmpSrv = oCompany.GetCompanyService
oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)

'Set parameters
oReportParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams)
oReportParam.ReportCode = "POR2"

'Get the default layout for the specific document
oReportLayout = oReportLayoutService.GetDefaultReportLayout(oReportParam)

'Print the report layout name
Debug.WriteLine(oReportLayout.Name)

See Also