cancel
Showing results for 
Search instead for 
Did you mean: 

Getting properties from infoobjects

Former Member
0 Kudos

Post Author: joiherm

CA Forum: .NET

Hi all,

I am trying to get repository information out from the Business Objects for example the last run time of the repport (SI_LAST_RUN_TIME). I'm coding in .NET C#. The reports are most of them WebI reports.

I've got some properties but I need to get more...

Here is a code example of what I've done so far:

-


//Here are the imports:

using CrystalDecisions.Enterprise;

using CrystalDecisions.Enterprise.Desktop;

using CrystalDecisions.Enterprise.Viewing;

using CrystalDecisions.ReportAppServer.Controllers;

using CrystalDecisions.Enterprise.WebControls;

using BusinessObjects.Enterprise.Desktop;

//Then the code

SessionMgr sessionMgr = new SessionMgr();

EnterpriseSession enterpiseSession = sessionMgr.Logon("Administrator", "", serverName, "secEnterprise");

EnterpriseService enterpiseService = enterpiseSession.GetService("InfoStore");

InfoStore infoStore = new InfoStore(enterpiseService);

string queryString = "SELECT * FROM CI_INFOOBJECTS where SI_NAME='reportName'";

InfoObjects infoObjects = infoStore.Query(queryString);

for (int i = 1; i <= infoObjects.Count; i++)

{

InfoObject infoReport = infoObjects&#91;i&#93;;

Webi WebI = (Webi)infoReport;

//I am not able to cast the infoReport to an Report because it is a WebI report

//Report report = (Report)infoReport;

listBox1.Items.Add(infoReport.ID);

listBox1.Items.Add(infoReport.Title);

listBox1.Items.Add(WebI.Instance);

listBox1.Items.Add("----


");

}

I've found some examples on the internet but that I've found I have not been able to use in my .NET C# application because it is a java code.//get the object

IInfoObject obj=(IInfoObject)objs.get(0);

//get the SI_INSTANCE property

int SI_INSTANCE =obj.properties().getProperty(CePropertyID.SI_INSTANCE). getValue();Is there anybody that can help me with this problem?Johann

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Post Author: Argan

CA Forum: .NET

Try something like:

infoReport.Properties&#91;"SI_LAST_RUN_TIME"&#93;.ToString()

Answers (0)