📚 SAP Business One SDK Help

SetDefaultReport Method
See Also  Example
ppIDefaultReportParams
Specifies a report to set as the default for a specific document type.

Description

Sets the specified report layout as default for a specific document type.

Syntax

Visual Basic
Public Sub SetDefaultReport( _
   ByVal ppIDefaultReportParams As DefaultReportParams _
) 

Parameters

ppIDefaultReportParams
Specifies a report to set as the default for a specific document type.

Example

Setting a default report layout (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oReportLayoutService As ReportLayoutsService
Dim oDefaultReportParams As DefaultReportParams

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

'Set parameters
oDefaultReportParams = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams)
oDefaultReportParams.LayoutCode = "POR20005"
oDefaultReportParams.ReportCode = "POR2"
oDefaultReportParams.UserID = 1

'Set the report as default
oReportLayoutService.SetDefaultReport(oDefaultReportParams)

See Also