cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple scheduling Webi Report using java sdk

Former Member
0 Kudos

Hello ...

I want to schedule multiple dynamic report.

Suppose I have 5 report and I want to schedule all these 5 reports.

Report 1  - Time take to schedule 2 min

Report 2  - Time take to schedule 10 min

Report 3  - Time take to schedule 5 min

Report 4  - Time take to schedule 1 min

Report 5  - Time take to schedule 30  min

So my question is , How to get the status of scheduled report means pending , success using java sdk in jsp.

and once the report is scheduled,Report is saved into the destination as File location onto the server. so how to get that File location into the JSP

Thanks and Regards,

Amit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amit,

Below is the sample code to get the status of a scheduled report using java sdk:

<%@ page import="com.crystaldecisions.sdk.framework.*" %>

<%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>

<%@ page import="com.crystaldecisions.sdk.properties.*" %>

<%@ page import="com.businessobjects.sdk.plugin.desktop.webi.*" %>

<html>

<title>Check Schedule Status of Webi Document Instances</title>

<head> <h2>Check Schedule Status of Webi Document Instances</h2></head>

<body>

<table border="2" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">

<tr>

<th width="10%">Instance ID</th>

<th width="30%">Instance Name</th>

<th width="20%">SI_SCHEDULE_STATUS</th>

</tr>

<%

String username = "<username>";

String password = "<password>";

String cmsname = "<CMS Name>";

String authtype = "<Authentication Tupe>";

IInfoObject oInfoObject =null;

IWebi oReport = null;

IProperties oProperties = null;

IProperty oProperty = null;

Object value = null;

try

{

  IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname,authtype);

  IInfoStore oInfoStore = (IInfoStore)es.getService("","InfoStore");

  String query = "select * from ci_infoobjects where si_kind='webi' and si_instance = 1";

  IInfoObjects oInfoObjects = oInfoStore.query(query);

 

  for(int i=0; i<oInfoObjects.size(); i++)

  {

  oInfoObject = (IInfoObject)oInfoObjects.get(i);

  oReport = (IWebi)oInfoObject;

  oProperties = oReport.properties();

  oProperty = oProperties.getProperty("SI_SCHEDULE_STATUS");

  value = oProperty.getValue();

  String status = chkStatus(value);

  out.print("<tr><td align=center>" + oReport.getID() +"</td><td align=center>"+ oReport.getTitle() + "</td><td align=center>" +  status + "</td></tr>");

  }

}

catch(Exception e)

{

  out.print(e);

}

%>

<%!

String chkStatus(Object value)

{

  String status = value.toString();

  String[] statusValue = {"RUNNING","COMPLETE","FAILURE","PAUSED","PENDING"};

  if(status.equals("0"))

  {

  return statusValue[0];

  }

  else if(status.equals("1"))

  {

  return statusValue[1];

  }

  else if(status.equals("3"))

  {

  return statusValue[2];

  }

  else if(status.equals("8"))

  {

  return statusValue[3];

  }

  else if(status.equals("9"))

  {

  return statusValue[4];

  }

  else

  {

  return null;

  }

}

%>

</table>

</body>

</html>

For the other task i.e. to retrieve the destination path of a scheduled report, please find the sample jsp code attached with this response. Please find the attached sample jsp code.

Hope it helps.

Regards,

Anchal

Former Member
0 Kudos

Hi Anchal,

Thank you for your reply ..

But my question is that you used the query to get the scheduled report

String query = "select * from ci_infoobjects where si_kind='webi' and si_instance = 1";

Here I will get the all Webi report which gets scheduled.

But what if my report is pending in state and after certain time scheduled complete.

I have to show in jsp continuous status of report ,means if the webi report is into the pending state then status show pending when scheduled complete status should change pending to complete.

Here should I call query every after certain time ?

Thanks,

AP.

former_member189544
Contributor
0 Kudos

Hi AP,

yes, obviously you will need to repeatedly query the infostore to update this information. You can narrow down the queries by using the IDs/ParentIDs of the instances and sort them by update-timestamps. The file-location is also included in the meta-data of the instance-object and can be retrieved via a query and shown on the output.

Regards,

Harald

Answers (0)