cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Business One Crystal Reports - Visual Studio Issue

0 Kudos

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;                
            }

Accepted Solutions (0)

Answers (2)

Answers (2)

DellSC
Active Contributor
0 Kudos

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

-Dell

0 Kudos

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 Kudos

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.