Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 




How to open a connection to BOE and get Crystal Reports, WEBI Doc's and Universes (Classic Designer) in a .NET application

Purpose

The document applies to Business Objects Enterprise and .NET SDK:


  1. Connecting to BOE and get a session

  2. Connect to BOE and query for Crystal Reports and preview

  3. Connect to BOE and query Universes and get a table count

  4. Connect to BOE and query for WEBI Doc's and open them in a Browser

  5. AllDB version will get all the database info for all CR Reports and other info (updated)


Comment out any code you don't need to test as required.

Overview

This application uses the BOE .NET SDK package to query a BOE Server. It is a simple as we can get and can be used a starting point and quick test to verify it all works.



Note: To add the Universe Designer to the project you first need to add the Client Tools to the local Development PC and run it once. This creates a DESIGNER.TLB file, in the project now add the TLB file and it should now work.





THE APPLICATION:

The Basics – Loading the application




Top area is where you enter the info to connect to your BOE Server

Use the Localhost check box if your application is on the same PC as your Visual Studio is installed on.

BOE port 6400 is the default.

Top Middle area is to get Universes and then once selected get the table count.

Below that is to get the WEBI doc's and open it in a Browser, must select the browser first and the Browser must be installed.

To get Crystal Reports from your BOE Server, this is known as Managed Reports, click on the LIST button.

For CR Reports, once the drop down list is populated select the report you want to open.

Click the Managed button to open the report, View Report button is now enabled.

NOTE: The LIST button is used for all types...

The Count box will populate if the connection to BOE works and there are Reports/Doc's/ Universes.


How it works:

Looking at the code the first thing you need to do is log onto your BOE Server:

For CR Reports you can get them this way. And this will connect using the provided log on info to your BOE server and get a session:
private void btnListReports_Click(object sender, EventArgs e)
{
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObjects infoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;

btnReportObjects.Text += "\nConnected to BOE Server - ";
btnReportObjects.AppendText(btrDataFile.Text + "- getting list of Reports ****** PLEASE WAIT ******\n");
btnReportObjects.Update();

try
{
if (ChkLocalHost.Checked)
btrDataFile.Text = System.Environment.MachineName + ":6400";
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
//return;
}

try
{
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

If the app fails at this point you either need to adjust the connection info, this is logging into BOE so use an Administrator account so it can query the server for reports.

Once it has logged on then it queries the CMS for all reports:
    enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
infoObjects = infoStore.Query("SELECT SI_NAME, SI_ID, SI_GUID FROM CI_INFOOBJECTS WHERE SI_KIND='CrystalReport'");
//ceinfoObjects = infoObjects;
int BItboxManagedRptCount = 0;

foreach (CrystalDecisions.Enterprise.InfoObject IObj in infoObjects)
{
ManagedReportsListBox.Items.Add(IObj.ID + " : " + IObj.Title.ToString());
++BItboxManagedRptCount;
tboxManagedRptCount.Text = BItboxManagedRptCount.ToString();
}

// this line should return the number of concurrent reports being executed
//int xxx = CrystalDecisions.CrystalReports.Engine.ReportDocument.GetConcurrentUsage();
infoObjects = infoStore.Query("Select * From CI_SYSTEMOBJECTS Where SI_PROGID='CrystalEnterprise.Server' and SI_DESCRIPTION='Crystal Reports 2016 Report Application Server'");
CrystalDecisions.Enterprise.Desktop.Server currentServer = (CrystalDecisions.Enterprise.Desktop.Server)infoObjects[1];
CrystalDecisions.Enterprise.Desktop.Server svr = (CrystalDecisions.Enterprise.Desktop.Server)currentServer;

CrystalDecisions.Enterprise.Admin.ReportAppServerAdmin rptAppAdmin = (CrystalDecisions.Enterprise.Admin.ReportAppServerAdmin)svr.ServerAdmin;

btnReportObjects.Text += "\nDoc Count: " + rptAppAdmin.CurrentDocumentCount;
btnReportObjects.Text += "\nMax Num Records: " + rptAppAdmin.MaxNumOfRecords;
btnReportObjects.Text += "\nMax Report Jobs: " + rptAppAdmin.MaxReportJobs;
btnReportObjects.Text += "\nN um of Browsing REcords: " + rptAppAdmin.NumOfBrowsingRecords;


//serverMetrics.CurrentDocumentCount.ToString();
//btnReportObjects.Text += "\nOpen Connections: " + serverMetrics.CurrentDocumentCount.ToString() + "\n";

// now that the report ID's are listed close this session - opens a new session when report is opened
enterpriseSession.Dispose();
}

This is all triggered when you click the LIST button:



Note the Count has now been populated as well as the SDK version you are using. Verify the version is the same version as your BOE server is using, if it is not you need to upgrade one of them. We only support the same version.

I load the GUID ID so you can verify it is the right object.

You can now Preview the report using the Desktop Windows form viewer, or close the report.

Getting Universes: ( classic - will not open a new unx Universe )

Same basic work flow for Universes now, this section queries the CMS and populates the list box:
private void btnGetUniverses_Click(object sender, EventArgs e)
{

ManagedReportsListBox.Items.Clear();
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObjects infoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;

btnReportObjects.Text += "Connected to BOE Server - ";
btnReportObjects.AppendText(btrDataFile.Text + "- getting list of Universes ****** PLEASE WAIT ******\n");
btnReportObjects.Update();

try
{
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
//infoObjects = infoStore.Query("SELECT SI_NAME, SI_KIND, SI_ID, SI_GUID, SI_PARENTID FROM CI_SYSTEMOBJECTS, CI_APPOBJECTS WHERE SI_KIND='Universe'");
infoObjects = infoStore.Query("SELECT * FROM CI_SYSTEMOBJECTS, CI_APPOBJECTS WHERE SI_KIND='Universe'");
//ceinfoObjects = infoObjects;
int BItboxManagedRptCount = 0;

foreach (CrystalDecisions.Enterprise.InfoObject IObj in infoObjects)
{
btnReportObjects.Text += "\nFolder CUID: " + IObj.CUID + " - SI_ID: " + IObj.ID + " : " + IObj.Title.ToString();
ManagedReportsListBox.Items.Add(IObj.ID + " : " + IObj.Title.ToString());
++BItboxManagedRptCount;
tboxManagedRptCount.Text = BItboxManagedRptCount.ToString();
}
// now that the report ID's are listed close this session - opens a new session when report is opened
enterpriseSession.Dispose();
}

To begin click the Universes button to populate the list of Universes.

This action gets a session, logs onto BOE and queries the CMS for the Universes, note the Folder ID and CUID of the object is retrieved as well if you need to do something by that property. Once the list box is filled, close that session, a new session is created when opening the Universe.

Select the Universe you want to see and note the info in the right hand box includes the CUID, List box includes the Object ID:



 

Code to get the Universe info, all it does is get a table count just to verify it did open the Universe. You can add more details as required.
private void btnUniverse_Click(object sender, EventArgs e)
{
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObjects infoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;

try
{
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);

//ReportAppFactory Raf = (ReportAppFactory)enterpriseSession.GetService("RASReportFactory").Interface;
DateTime dtStart;
TimeSpan difference;

try
{
dtStart = DateTime.Now;
if (ManagedReportsListBox.SelectedItem != null)
{
try
{
if (ChkLocalHost.Checked)
MyUNIApp.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
MyUNIApp.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

MyUNIApp.Interactive = false;

string MySTRTemp = ManagedReportsListBox.SelectedItem.ToString();
int MySI_ID = MySTRTemp.LastIndexOf(@":");
// remove the ID, only wants the name of universe
string MyUNIName = ManagedReportsListBox.Text.Remove(0, MySI_ID+2);
int MMySTRTemp = Convert.ToInt32(ManagedReportsListBox.Text.Substring(0, MySI_ID));

// starting point for default Universes
IUniverseFolder myfolder = MyUNIApp.UniverseRootFolder;

//// get the Universe if it's in the root folder
//if (myfolder.Path == @"/")
//{
// try
// {
// IUniverse MYUNIV = MyUNIApp.Universes.OpenFromEnterprise(@"/", MyUNIName.ToString());
// //MessageBox.Show((dynamic) MYUNIV.Parent.ToString());
// btnReportObjects.Text += "\n" + "Table Count: " + MYUNIV.Tables.Count.ToString();
// }
// catch (Exception ex)
// {
// btnReportObjects.Text += "ERROR: " + ex.Message;
// //return;
// }
//}
// get the universe under a folder
{
if (MyUNIApp.UniverseRootFolder.Folders.Count >= 1)
{
// get the GUID from BOE and compare it to Designer GUID to verify it is the one selected.
infoObjects = infoStore.Query("SELECT * FROM CI_SYSTEMOBJECTS, CI_APPOBJECTS WHERE SI_ID='" + MMySTRTemp + "'");
string MyCUID = infoObjects[1].ParentCUID.ToString();

foreach (Designer.UniverseFolder myUnvFolder in MyUNIApp.UniverseRootFolder.Folders)
{
if (MyCUID == myUnvFolder.CUID) // || myUnvFolder.Name == MyUNIName.ToString())
{
string MyUNIFolder = myUnvFolder.Path.ToString();
Designer.Universe myUnv = MyUNIApp.Universes.OpenFromEnterprise(MyUNIFolder, MyUNIName.ToString());
btnReportObjects.Text += "\n" + "Table Count: " + myUnv.Tables.Count.ToString();
}
}
}
}

btnReportName.Text = "CUID - " + MySTRTemp;

difference = DateTime.Now.Subtract(dtStart);
btnReportObjects.Text += "\n\nReport Document Load: " + difference.Minutes.ToString() + ":" + difference.Seconds.ToString() + "\r\n";
btnCloserpt.Enabled = false;

dtStart = DateTime.Now;
ViewReport.Enabled = true;
btnCloserpt.Enabled = true;

cbLastSaveHistory.Text = "";
}
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}
// do not modify this works
ViewReport.Enabled = true;
btnCloserpt.Enabled = true;
}

 

Opening WEBI Documents:

WEBI Doc's do not have a Desktop Windows form viewer to preview them in so you need to select which browse you want to use first.

Also note this app is going to load the designer.exe to execute the WEBI Doc.
private void btnGetWebi_Click(object sender, EventArgs e)
{

ManagedReportsListBox.Items.Clear();
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObjects infoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;

btnReportObjects.Text += "\nConnected to BOE Server - ";
btnReportObjects.AppendText(btrDataFile.Text + "- getting list of Reports ****** PLEASE WAIT ******\n");
btnReportObjects.Update();

try
{
if (ChkLocalHost.Checked)
btrDataFile.Text = System.Environment.MachineName + ":6400";
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
//return;
}

try
{
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
infoObjects = infoStore.Query("SELECT SI_NAME, SI_ID, SI_GUID FROM CI_INFOOBJECTS WHERE SI_KIND='webi'");
//ceinfoObjects = infoObjects;
int BItboxManagedRptCount = 0;

foreach (CrystalDecisions.Enterprise.InfoObject IObj in infoObjects)
{
ManagedReportsListBox.Items.Add(IObj.ID + " : " + IObj.Title.ToString());
++BItboxManagedRptCount;
tboxManagedRptCount.Text = BItboxManagedRptCount.ToString();
}

// this line should return the number of concurrent reports being executed
//int xxx = CrystalDecisions.CrystalReports.Engine.ReportDocument.GetConcurrentUsage();
infoObjects = infoStore.Query("Select * From CI_SYSTEMOBJECTS Where SI_PROGID='CrystalEnterprise.Server' and SI_DESCRIPTION='Crystal Reports 2016 Report Application Server'");
CrystalDecisions.Enterprise.Desktop.Server currentServer = (CrystalDecisions.Enterprise.Desktop.Server)infoObjects[1];
CrystalDecisions.Enterprise.Desktop.Server svr = (CrystalDecisions.Enterprise.Desktop.Server)currentServer;

CrystalDecisions.Enterprise.Admin.ReportAppServerAdmin rptAppAdmin = (CrystalDecisions.Enterprise.Admin.ReportAppServerAdmin)svr.ServerAdmin;

btnReportObjects.Text += "\nDoc Count: " + rptAppAdmin.CurrentDocumentCount;
btnReportObjects.Text += "\nMax Num Records: " + rptAppAdmin.MaxNumOfRecords;
btnReportObjects.Text += "\nMax Report Jobs: " + rptAppAdmin.MaxReportJobs;
btnReportObjects.Text += "\nNumber of Browsing Records: " + rptAppAdmin.NumOfBrowsingRecords;


//serverMetrics.CurrentDocumentCount.ToString();
//btnReportObjects.Text += "\nOpen Connections: " + serverMetrics.CurrentDocumentCount.ToString() + "\n";

// now that the report ID's are listed close this session - opens a new session when report is opened
enterpriseSession.Dispose();
}



So first you click on Get WEBI to log in and load the WEBI doc's into the list box.

Select a browser that you have installed and note that IE has a 2K limit for the URL so it may not work, depends on how many times that user has logged in, it grows with each log in.
private void btnURLWebiRun_Click(object sender, EventArgs e)
{
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObjects infoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;
string mySession = "";

try
{
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);

// get serilized session
mySession = enterpriseSession.SerializedSession;

}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);

//ReportAppFactory Raf = (ReportAppFactory)enterpriseSession.GetService("RASReportFactory").Interface;
DateTime dtStart;
TimeSpan difference;

if (LstBrowser.SelectedItem == null)
MessageBox.Show("Please select a Browser to render the report in");
else
{
string MyObjectType = LstBrowser.SelectedItem.ToString();

try
{
dtStart = DateTime.Now;
if (ManagedReportsListBox.SelectedItem != null)
{
try
{
if (ChkLocalHost.Checked)
MyUNIApp.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
MyUNIApp.Logon(btrFileLocation.Text, btrPassword.Text, btrDataFile.Text, btrSearchPath.Text);

//enterpriseService = enterpriseSession.GetService("InfoStore");

}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}

//MyUNIApp.Visible = false;
MyUNIApp.Interactive = false;

string MySTRTemp = ManagedReportsListBox.SelectedItem.ToString();
int MySI_ID = MySTRTemp.LastIndexOf(@":");
// remove the ID, only wants the name of WEBI doc
string MyUNIName = ManagedReportsListBox.Text.Remove(0, MySI_ID + 2);
int MMySTRTemp = Convert.ToInt32(ManagedReportsListBox.Text.Substring(0, MySI_ID));

btnReportName.Text = "CUID - " + MySTRTemp;
infoObjects = infoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_ID='" + MMySTRTemp + "'");
string MyCUID = infoObjects[1].CUID.ToString();

difference = DateTime.Now.Subtract(dtStart);
btnReportObjects.Text += "\n\nReport Document Load: " + difference.Minutes.ToString() + ":" + difference.Seconds.ToString() + "\r\n";
btnCloserpt.Enabled = false;

dtStart = DateTime.Now;
StringWriter writer = new StringWriter();
string myEncodeSession = System.Web.HttpUtility.UrlEncode(mySession);

string myURL = @"http://" + txtTomcatServerPort.Text.ToString() + @"/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=" + MyCUID + "&serSes=" + myEncodeSession;

switch (MyObjectType)
{
case "IE":
{
//Session info too long for IE to use 20xx characters max maybe, depends on how old that user is...
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Internet Explorer\iexplore.exe", myURL);
}
break;
case "Firefox":
{
System.Diagnostics.Process.Start(@"C:\Program Files\Mozilla Firefox\firefox.exe", myURL);
}
break;
case "Chrome":
{
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", myURL);
}
break;
case "Other":
{
//System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Internet Explorer\iexplore.exe", myURL)
}
break;
default:
System.Diagnostics.Process.Start(@"C:\Program Files\Mozilla Firefox\firefox.exe", myURL);
break;

}

//http://BIPW12R2:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AY7lzhaXLgVDoRARitXX9kM // ID 5933
cbLastSaveHistory.Text = "";
}
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
return;
}
// do not modify this works
ViewReport.Enabled = true;
btnCloserpt.Enabled = true;
}

}

 

Requirements:

These are the basic CR/BOE assemblies required:
//Add these required Crystal Assemblies to your project
using CrystalDecisions.Windows.Forms;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.ReportDefModel;
using Designer;
using CrystalDecisions.Enterprise.Desktop;
using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

And globally defined Objects:
public class frmMain : System.Windows.Forms.Form
{
//.....
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument rptClientDocMgd;
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
Designer.Application MyUNIApp = new Designer.Application();

To get the version of the Engine I do this on load:
public frmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

foreach (Assembly MyVerison in AppDomain.CurrentDomain.GetAssemblies())
{
if (MyVerison.FullName.Substring(0, 38) == "CrystalDecisions.CrystalReports.Engine")
{
//File: C:\Windows\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\13.0.2000.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll
//InternalName: Crystal Reports
//OriginalFilename:
//FileVersion: 13.0.9.1312
//FileDescription: Crystal Reports
//Product: SBOP Crystal Reports
//ProductVersion: 13.0.9.1312
//Debug: False
//Patched: False
//PreRelease: False
//PrivateBuild: False
//SpecialBuild: False
//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 Cortez - managed reporting )
CRVer = fileVersionInfo.FileVersion.Substring(0, 2);
//return;
}
}

 

Latest update:

Added routine to get a list of Packages and then scheduling the package.

private void btrSchedule_Click(object sender, EventArgs e)
{
CrystalDecisions.Enterprise.SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
CrystalDecisions.Enterprise.EnterpriseService enterpriseService;
CrystalDecisions.Enterprise.EnterpriseSession enterpriseSession;

CrystalDecisions.Enterprise.InfoObject RPTinfoObject;
CrystalDecisions.Enterprise.InfoObjects RPTinfoObjects;
CrystalDecisions.Enterprise.InfoStore infoStore;
CrystalDecisions.Enterprise.InfoObjects ceInfoObjects;
CrystalDecisions.ReportAppServer.Controllers.RowsetController boRowSetController;
CrystalDecisions.Enterprise.Admin.ISReportAppServerAdmin serverMetrics; // = new CrystalDecisions.Enterprise.Admin.ISReportAppServerAdmin();

try
{
//enterpriseSession = sessionMgr.Logon("Administrator", "Password1", btrDataFile.Text, "secEnterprise");
if (ChkLocalHost.Checked)
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, System.Environment.MachineName + ":6400", btrSearchPath.Text);
else
enterpriseSession = sessionMgr.Logon(btrFileLocation.Text, btrPassword.Text, btrFileLocation.Text, btrSearchPath.Text);

enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new CrystalDecisions.Enterprise.InfoStore(enterpriseService);
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
return;
}

ReportAppFactory Raf = (ReportAppFactory)enterpriseSession.GetService("RASReportFactory").Interface;
DateTime dtStart;
TimeSpan difference;

try
{
dtStart = DateTime.Now;
if (ManagedReportsListBox.SelectedItem != null)
{
string MySTRTemp = ManagedReportsListBox.SelectedItem.ToString();
int MySI_ID = MySTRTemp.LastIndexOf(@":");
int MMySTRTemp = Convert.ToInt32(ManagedReportsListBox.Text.Substring(0, MySI_ID));

CrystalDecisions.Enterprise.InfoStore istore = new CrystalDecisions.Enterprise.InfoStore(enterpriseSession.GetService("InfoStore"));
//Query CMS for the report.
ceInfoObjects = istore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_ID='" + MMySTRTemp + "'");

// now open the report using Engine from FRS to get various properties
RPTinfoObjects = infoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_ID='" + MMySTRTemp + "'");
istore.Schedule(RPTinfoObjects);

BusinessObjects.Enterprise.Desktop.Publication myPub;
myPub = (BusinessObjects.Enterprise.Desktop.Publication)ceInfoObjects[1];

//btnReportName.Text = "CUID - " + MySTRTemp;

difference = DateTime.Now.Subtract(dtStart);
btnReportObjects.Text += "Report Document Load: " + difference.Minutes.ToString() + ":" + difference.Seconds.ToString() + "\r\n";
btnCloserpt.Enabled = false;

dtStart = DateTime.Now;
ViewReport.Enabled = true;
btnCloserpt.Enabled = true;
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
return;
}
}

Latest updates:

UI change to dynamically set the CMS Port and Tomcat port.

Fixed Universe Designer code, changes need to be made also to open a local copy of the UNV since we no longer support opening the Universe from the BOE server.

When opening the Universe you'll need to direct ir to a local copy and not load it from the BOE/CRS Server.


Update: BOEManagedAllDB.zip

New UI properties:


Run Time now show the platform - x86 or x64

Removed the Universe part - eventually you need to upgrade to UNX's and only opens the Universion if Off line mode so not much use.

History now show the Report history once you have selected a report.

Open all CR Reports in this version will get all the DB Database and Tables used in the Report, including Cammand Objects.

WARNING - DO NOT push any other buttons until a developer can open the application and verify nothing is going to be alter. This version is only to get the DB info