cancel
Showing results for 
Search instead for 
Did you mean: 

Error while Report select in .NET Appl.

Former Member
0 Kudos

Dear Experts !!

I'm a newbie !! Apologies if its a basic problem or improper understanding on my part.

We are on BO XI 3.0 and I'm using a client installation of BO XI 3.1. I'm trying to access and schedule a crystal report using the following code. The problem is the query "Select * from ci_infoobjects " does not get this crystal report. Although, I'm able to access the same through Infoview as well as schedule through CMC. Any help will be highly appreciated.

P.S : As a last resort, I used a for loop to traverse the complete dataset and trap the report SID within. But to no result {:<}

Code attached for you reference :

String user, password, cmsName, cmsAuthType;

SessionMgr sessionMgr = new SessionMgr();

//Proivider Details for Logon to be prepared

BOEMembershipProvider boep = new BOEMembershipProvider();

int i;

//user = "asinghbo";

user = "bidevelop";

// password = "ganesha8";

password = "biril@123";

cmsName = "BOBJECT";

cmsAuthType = "secEnterprise";

try

{

EnterpriseSession sess = sessionMgr.Logon(user, password, cmsName, cmsAuthType);

EnterpriseService boEnterpriseService = sess.GetService("", "InfoStore");

//Reporting Objects

InfoStore boInfoStore;

InfoObjects boReportObjects;

InfoObject boReportObject;

Report boReport;

SchedulingInfo boSchedulingInfo;

String query;

//Create the infostore object

boEnterpriseService = sess.GetService("", "InfoStore");

boInfoStore = new InfoStore(boEnterpriseService);

//Create query to grab the desired report

query = "Select SI_ID, SI_NAME from CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report'";// AND SI_ID = ''";

//+ " AND SI_NAME='AR_ER_CR_100'";

//"AND SI_ID=64454";// AND SI_INSTANCE=0";

//query = "Select SI_ID, SI_NAME from CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' "

// + "AND SI_NAME='Debtors' AND SI_INSTANCE=0";

boReportObjects = boInfoStore.Query(query);

//check for returned reports

if (boReportObjects.Count > 0)

{

for (i = 1;boReportObjects.Count<=boReportObjects.Count;i++)

{

boReportObject = boReportObjects<i>;

boReport = (Report)boReportObject;

if (boReport.ID.ToString() == "64454")

{

boSchedulingInfo = boReport.SchedulingInfo;

//Create the parameters for our recurring schedule

//run first instance 2 minutes from now

DateTime currentTime = DateTime.Now.AddMinutes(2);

//recurrance lasts for one day

DateTime endTime = currentTime.AddDays(1);

//Set the report to run on a recurring basis every 4 hours and 30 minutes

//running for one day

boSchedulingInfo.BeginDate = currentTime;

boSchedulingInfo.EndDate = endTime;

boSchedulingInfo.IntervalHours = 5;

boSchedulingInfo.IntervalMinutes = 1;

boSchedulingInfo.Type = CeScheduleType.ceScheduleTypeHourly;

//schedule the report

boInfoStore.Schedule(boReportObjects);

Response.Write("The " + boReport.Properties["SI_NAME"].ToString()

+ " report will run every 4 hours and 30 minutes for one day");

}

}

}

else

{

//no objects returned by query

Response.Write("No report objects found by query <br>");

Response.Write("Please click <a href='Default.aspx'>here</a> to return to the logon page.<br>");

}

Response.Write("You are logged in!!!!!");

}

catch (Exception exp)

{

Response.Write("ERROR: " + exp.ToString());

}

Regds,

Srinivasan.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The problem got solved, when I gave the user the access to the folder that contained the report.

Regds,

Srinivasan

former_member184995
Active Contributor
0 Kudos

What Jonathan said is correct, check to make sure you are getting the report back.

Also, if you are trying to use the XI 3.1 .NET runtimes against XI 3.0 (ie not XI 3.1) then I have no idea what may or may not happen as that version of the product does not support .NET.

Jason

Former Member
0 Kudos

Hi, Srinivasan;

The first thing you need to see is if the query is valid. Try running it through the Query Builder in the Business Objects Enterprise program group. If it doesn't return an instance of a report there, that is why it is not working in .NET.

Regards,

Jonathan