Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Re: Unable to cast COM object of type 'System.__ComObject' to interface type

$
0
0

Hi Ketan,

 

I saw two sintax errors in your code.

 

Change the line:

 

SAPbobsCOM.ReportTypesService rptTypeService = (SAPbobsCOM.ReportTypesService)(oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService));

by:

 

SAPbobsCOM.ReportTypesService rptTypeService = (SAPbobsCOM.ReportTypesService)(oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportTypesService));

And, change the line:

 

SAPbobsCOM.BlobParams oBlobParams = (SAPbobsCOM.BlobParams)(oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService));

by:

 

SAPbobsCOM.BlobParams oBlobParams = (SAPbobsCOM.BlobParams)(oCompany.GetCompanyService().GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlobParams));

Hope it helps,

 

Regards,

Diego


Viewing all articles
Browse latest Browse all 2695

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>