📚 SAP Business One SDK Help

GetDefaultReport 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 GetDefaultReport( _
   ByVal pIReportParams As ReportParams _
) As DefaultReportParams

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 GetDefaultReportLayout method, except that this method returns the key to the report layout and not the ReportLayout object for the report layout.

Example

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

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

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

'Get default layout for specific document (Purchase Order)
oReportParaDefault = oReportLayoutService.GetDefaultReport(oReportParam)

'Print the layout code
Debug.WriteLine(oReportParaDefault.LayoutCode)

See Also