Hi all - I'm trying to use the Crystal Report Viewer for Visual Studio 2010 with Crystal Reports Server 2008, and I'm not having much success. I'm attempting to view the report from an ASP.Net page.
I have this code in an ASP.Net Page:
string serverName = "MyServer"; SessionMgr sessionMgr = new SessionMgr(); EnterpriseSession enterpriseSession = sessionMgr.Logon("User", "Password", serverName, "secEnterprise"); EnterpriseService enterpriseService = eterpriseSession.GetService("InfoStore"); InfoStore infoStore = new InfoStore(enterpriseService); InfoObjects infoObjects = infoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' AND SI_NAME LIKE 'MyReportName%' AND SI_INSTANCE=0"); InfoObject infoObject = infoObjects; enterpriseService = enterpriseSession.GetService("RASReportFactory"); Object rrfObject = enterpriseService.Interface; ReportAppFactory reportAppFactory = (ReportAppFactory)rrfObject; ReportClientDocument reportClientDocument = reportAppFactory.OpenDocument(infoObjects); CrystalReportViewer1.ReportSource = reportClientDocument;
When the OpenDocument call is made, I get an exception: "The parameter was incorrect". Note that most of the sample code that I've found passes the ID property of the InfoObject, but that gives me another exception: "No such interface supported".
Am I just missing something really obvious?
PhilWednesday, January 26, 2011 2:20 PM
Crystal Reports for Visual Studio 2010 is the only version that is supported in VS 2010.
It does not include connectivity to CRS 2008 or any CR or BOE Servers. The next release OF CR and SDK's will only be able to connect to BOE 4.0.
Use VS 2008 and CR 2008 SDK to connect to CRS 2008.
DonSaturday, February 12, 2011 6:34 PM
Correct, It may work but if there are issues we can't get them fixed. For now you'll have to stay on VS 2008 /2005 with CR 2008 until BOE 4.0 and the .NET SDK is released with Service Pack 2. Also, you can't simply download the SDK and use it, you are not licensed to do so, you must own a copy of Crystal Reports to be able to use the SDK. For a complete reference on licensing see this Paper written by Blair Wheadon who is one of SAP Crystal Reports Senior Product Managers.
Atik, from the code Marino posted it is definitely SAP Enterprise code to access the CMC Server. For BOE/CRS samples see this link.
To connect to BOE/CRS/CRSE there are 2 assemblies you need to add to your project:
Neither are included with CR for VS 2010 and there are no plans to add this functionality to this free product.
Senior Support Engineer
AGS Primary Support, Business User
SAP Canada, Inc.
Don WilliamsThursday, April 21, 2011 4:31 AM