We want our Crystal Enterprise server to print a report. The request to print will come from a .Net web app that were building.
Weve tried all kinds of combinations of SAP DLLs and Visual Studio settings without success.
What DLLs should we reference? Where can we download these DLLs? Please provide a URL if possible we have an active SAP license so we can access the download we just dont know which one to use.
Should we reference these DLLs from the GAC (on the dev machine and on the production server), or should we copy them to the projects bin directory?
Also, we haven’t been able to located any SDK docs for this issue. Any URLs to docs would be fantastic.
Were using:
-
Crystal Enterprise (v14, I think, but not sure where to check)
-
Visual Studio 2015
-
.Net 4.62
-
Weve tried Platform target x86, x64, and Any CPU (we strongly prefer x64, if possible)
Here is the source code were attempting to use, based on the samples we could find on the SAP sites. Any recommendations for changes are appreciated.
string boAPS = "INTERNAL IPv4 ADDRESS REDACTED";
string boUserID = "CE10";
string boPassword = "PASSWROD REDACTED";
string boAuthorization = "secEnterprise";
string boReportName = "rptAPInvoiceListWithDistrib";
string boQuery = "SELECT * FROM CI_INFOOBJECTS WHERE SI_ProgId = 'CrystalEnterprise.Report'" +
" AND SI_NAME = '" + boReportName + "'" +
" AND prompt0=" + manifest.ManifestNumber + "'";
CrystalDecisions.Enterprise.EnterpriseSession boEnterpriseSession;
CrystalDecisions.Enterprise.InfoObject boInfoObject;
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument boReportClientDocument;
CrystalDecisions.Enterprise.SessionMgr boSessionMgr;
CrystalDecisions.Enterprise.InfoStore boInfoStore;
CrystalDecisions.Enterprise.EnterpriseService boEnterpriseService;
CrystalDecisions.Enterprise.InfoObjects boInfoObjects;
CrystalDecisions.ReportAppServer.ClientDoc.ReportAppFactory boReportAppFactory;
//Log on to the Enterprise CMS
boSessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
boEnterpriseSession = boSessionMgr.Logon(boUserID, boPassword, boAPS, boAuthorization);
Session.Add( "boEnterpriseSession", boEnterpriseSession );
boEnterpriseService = boEnterpriseSession.GetService("", "InfoStore");
boInfoStore = new CrystalDecisions.Enterprise.InfoStore(boEnterpriseService);
//Retrieve the report object from the InfoStore, only need the SI_ID for RAS
boInfoObjects = boInfoStore.Query(boQuery);
boInfoObject = boInfoObjects[1];
boEnterpriseService = null;
//Retrieve the RASReportFactory
boEnterpriseService = boEnterpriseSession.GetService("RASReportFactory");
boReportAppFactory = (CrystalDecisions.ReportAppServer.ClientDoc.ReportAppFactory)boEnterpriseService.Interface;
//Open the report from Enterprise
boReportClientDocument = boReportAppFactory.OpenDocument(boInfoObject.ID, 0);
boReportClientDocument.PrintOutputController.ModifyPrinterName(@"\\van-s-prt01\VAN-P-OLYMPIA");
//Print the report.
boReportClientDocument.PrintOutputController.PrintReport(null);
MrE (BOB member since 2017-05-18)