Skip to Content
0

SAP Business One Crystal Reports - Visual Studio Issue

May 14 at 06:16 AM

65

avatar image
Former Member

Hi

I have installed the SAP Crystal Reports Runtime installation from the below link. I am getting error "Error while connecting to Crystal Runtime; check the installation". There is no issue SAP DI API Connectivity and It works fine. Please help.

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads (VS2017 - SP21 and higher)

My environment details are below

1. OS: Windows 10 Enterprise - 64 bit

2. Visual Studio 2017 Enterprise

3. .NET 3.5 SDK Installed

4. SAP Business One 9.2 PL 10 - 64 bit

5. SAP Business One DI API 9.2 PL 10

My Test Code is below

var conCreator = new ConnectionCreator();
            var conSAP = conCreator.GetDIConnection("test");
            try
            {
                var connResult = conSAP.Connect();
                if (connResult != 0)
                {                   
                    throw new InvalidOperationException(string.Format("(ConnectSap){0}-{1}",
                        conSAP.GetLastErrorCode(), conSAP.GetLastErrorDescription()));
                }
                SAPbobsCOM.ReportLayoutsService oReportLayoutService;
                SAPbobsCOM.ReportLayoutPrintParams oPrintParam = null;
                var companyService = conSAP.GetCompanyService();
                oReportLayoutService = (ReportLayoutsService)companyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService);
                oPrintParam = (ReportLayoutPrintParams)oReportLayoutService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutPrintParams);
                oPrintParam.LayoutCode = "INV2014";
                oPrintParam.DocEntry = 54723;
                oReportLayoutService.Print(oPrintParam);
            }
            finally
            {
                if (conSAP != null) conSAP.Disconnect();
                conSAP = null;                
            }

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member May 14 at 11:34 AM
0

Please help me. I tried uninstall and install the SAP Business One, Crystal Reports Runtime etc., and still the same issue. Your help will be really appreciated.

Share
10 |10000 characters needed characters left characters exceeded
Dell Stinnett-Christy May 14 at 01:47 PM
0

IIRC, the Crystal .NET SDK does not include the ability to connect to B1.

-Dell

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I am using SAP DI API 9.2 PL 10 connect to business one and retrieve records. I am using ReportLayout Service to print the report. In this line oReportLayoutService.Print(oPrintParam); I am getting error Error while connecting to Crystal Runtime; check the installation

0