Skip to Content
0

[Error] - Using SAPbouiCOM.ActiveX for Crystal Report

Sep 19, 2017 at 09:03 AM

68

avatar image
Former Member

Hi experts, I'm having the error code of "Error HRESULT E_FAIL has been returned from a call to a COM component." when using the SAPbouiCOM.ActiveX. Below is my code snippet:

            Dim Actx As SAPbouiCOM.ActiveX
            Dim oItem As SAPbouiCOM.Item
            Dim oForm As SAPbouiCOM.Form


            Dim cR As CrystalActiveXReportViewerLib102.CrystalActiveXReportViewer


            oForm = SBO_Application.Forms.Add("frmTest", SAPbouiCOM.BoFormTypes.ft_Fixed, 1000100)
            oForm.Title = "Test Preview"
            oForm.Left = 350
            oForm.Top = 50
            oForm.ClientHeight = 380
            oForm.ClientWidth = 600


            oForm.Visible = True


            oItem = oForm.Items.Add("atx", SAPbouiCOM.BoFormItemTypes.it_ACTIVE_X)
            oItem.Top = 0
            oItem.Left = 0
            oItem.Width = oForm.Width
            oItem.Height = oForm.Height
            oItem.Visible = True


            Actx = DirectCast(oItem.Specific, SAPbouiCOM.ActiveX)
            Actx.ClassID = "{9899008A-DF67-4522-98B0-F7CDA5A5811B}"


            cR = Actx.Object
            cR.ReportSource = "D:\Report1.rpt"

See image below my error:

capture.jpg (87.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers