on 05-08-2006 2:43 PM
I am Using the following code in Visual Basic 6.0 :
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oReportLayoutService As ReportLayoutsService
Dim oReportLayout As ReportLayout
Dim oReportParam As ReportParams
'get company service
Set oCmpSrv = oCompany.GetCompanyService
'get report layout service
Set oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)
'get report params
Set oReportParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams)
'report code is the document type code (POR2=PurchaseOrder)
oReportParam.CardCode = "POR2"
'get the default layout of the specific document
Set oReportLayout = oReportLayoutService.GetDefaultReportLayout(oReportParam)
'set the new layout name
oReportLayout.Name = "My layout"
'set the new author name
oReportLayout.Author = "My Author"
'add the new layout to the specific document
oReportLayoutService.AddReportLayout (oReportLayout)
Then the system show the error : "run-time error'-2028"
when is executing the step : 'get the default layout of the specific document
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
'get company service
Set oCmpSrv = oCompany.GetCompanyService
'get report layout service
Set oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)
'get report params
Set oReportParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams)
'report code is the document type code (POR2=PurchaseOrder)
oReportParam.ReportCode = "POR2"
oReportParam.UserID = 1
oReportParam.CardCode = "V60000"
'get the default layout of the specific document
Set oReportLayout = oReportLayoutService.GetDefaultReportLayout(oReportParam)
'set the new layout name
oReportLayout.Name = "My layout"
'set the new author name
oReportLayout.Author = "My Author"
'add the new layout to the specific document
oReportLayoutService.AddReportLayout (oReportLayout)
It did´nt work, that I am trying to do is get a default report, then change some parameters and add the new report.
In the line : 'add the new layout to the specific document
oReportLayoutService.AddReportLayout (oReportLayout)
Show me the error message : run-time error '438'
Object doesn´t support this property or method
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.