Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Report Layout Service in 2005

Hi

I'm trying to use the report layout service to delete a layout, but it is always giving a error. I'm most probably doing something silly,here is the code. Please let me know if you see a problem

Try

Dim oReportLayout As SAPbobsCOM.ReportLayout

Dim oReportParam As SAPbobsCOM.ReportLayoutParams

'get report params

oReportParam = oReportLayoutService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutParams)

oReportParam.LayoutCode = "QUT20006"

'get the default layout of the specific document

oReportLayout = oReportLayoutService.GetReportLayout(oReportParam)

oReportLayout.Author = "manager"

oReportLayout.Name = "Sales Quotation_Test"

oReportLayoutService.DeleteReportLayout(oReportLayout)

sErrMsg = oCompany.GetLastErrorDescription()

If sErrMsg = Nothing Then

MsgBox("Completed succesffully")

Else

MsgBox("Error:" & sErrMsg)

End If

Catch ex As Exception

MsgBox(ex.Message)

End Try

Thanks in advance

replied

You should use oReportParam instead of oReportLayout in the call to DeleteReportLayout.

Good luck

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question