Not sure about what version your application is loading or supports or requires?
One way to do this is as follows....
- Visual Studio 2010, 2012 and 2013 and earlier version but not tested
- Crystal Reports for Visual Studio .NET
Add the following to the form Main:
// Required for Windows Form Designer support
foreach (Assembly MyVerison in AppDomain.CurrentDomain.GetAssemblies())
if (MyVerison.FullName.Substring(0, 38) == "CrystalDecisions.CrystalReports.Engine")
//InternalName: Crystal Reports
//FileDescription: Crystal Reports
//Product: SBOP Crystal Reports
//Language: English (United States)
System.Diagnostics.FileVersionInfo fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(MyVerison.Location);
txtRuntimeVersion.Text += fileVersionInfo.FileVersion.ToString();
// check if CrsytalDecisions.Enterprise dll's can be loaded ( Anything but version 13 - managed reporting )
if (fileVersionInfo.FileVersion.Substring(0, 2) == "13")
btnRasOpen.Enabled = false;
CRVer = fileVersionInfo.FileVersion.Substring(0, 2);
// TODO: Add any constructor code after InitializeComponent call
The above code also checks to see if the runtime available also supports connectivity to CRS, CRSE or BOE/BI 4.0/4.1
Note: Crystal Reports for Visual Studio version 13 Runtime is the only current version that does not support connecting to Business Objects Enterprise ( BI 4.0 or 4.1 ) also known as Managed Reporting.
CR for VS is unmanaged reporting only ( loading report files from the local hard drive).
KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem