Skip to Content

    Public Sub setDefaultLayout(_LayoutCode As String, _ReportCode As String, _UserID As Integer)

        Dim oCmpSrv As SAPbobsCOM.CompanyService

        Dim oReportLayoutService As ReportLayoutsService

        Dim oDefaultReportParams As DefaultReportParams

        ‘Get report layout service

        oCmpSrv = B1Connections.diCompany.GetCompanyService

        oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)

        ‘Set parameters

        oDefaultReportParams = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams)

        oDefaultReportParams.LayoutCode = _LayoutCode

        oDefaultReportParams.ReportCode = _ReportCode

        oDefaultReportParams.UserID = _UserID

        ‘Set the report as default

        oReportLayoutService.SetDefaultReport(oDefaultReportParams)

    End Sub

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply