cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with scheduling BO4 WEBI reports with prompts using java SDK

Former Member
0 Kudos

Below is my code for scheduling BO 4 WEBI reports with prompts using SDK. I am trying to FTP the report. I do not see any error while java run but the report file is not get uploaded to server.

IDestinationPlugin boDestinationPlugin = getDestinationPlugin(infoStore, ".xls");

ISchedulingInfo schedInfo = webi.getSchedulingInfo();

schedInfo.setRightNow(true);

schedInfo.setType(CeScheduleType.ONCE);

//Add this destination plugin to the object's scheduling info.

IDestinations boDestinations = schedInfo.getDestinations();

IDestination boDestination = boDestinations.add("CrystalEnterprise.Ftp");

boDestination.setFromPlugin(boDestinationPlugin);

//Schedule the InfoObjects.

infoStore.schedule(infoObjects);

Report history shows parameter passed as empty and error message as below.

Parameters:

Error Message:

exception raised: java.lang.NullPointerException

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

How are you passing parameters through your code? Are you entering the parameters using Report Engine SDKs, saving the report and then scheduling?

PromtsUtil was the class which was used for scheduling a webi reports with prompts, which was deprecated from BI 4.x along with many other Report Engine SDK features. Thus scheduling a webi reports with prompts is not possible with standard BusinessObjects SDKs. There is a workaround for this though, however it is not officially supirted or recommended by SAP.

The best option here would be to look for the new restful webservice sdks, as it is the future in terms of web intelligence document currently and you have most of the features deprectaed from XI 3.1 being introduced in Restful sdks for BI 4.x.

More information about Restful can be found here

http://scn.sap.com/community/restful-sdk

Thanks,

Prithvi

Former Member
0 Kudos

Thanks for reply Prithviraj.

I am now trying to to test WEBI reports with REST webservice.

Is the below used url or Accept parameter incorrect? here 93306 is the report id.

I tried different options for 'Accept' but the report file generated with incorrect data.

Attached is the screenshot for report.

try {

             String  baseURL = http://<server>:6405/biprws/

             URL url = new URL(baseURL+"raylight/v1/documents/93306");

             HttpURLConnection conn = (HttpURLConnection) url.openConnection();

             conn.setRequestMethod("GET");

             conn.setRequestProperty("Accept", "application/vnd.ms-excel");

             //conn.setRequestProperty("Accept", "text/plain");

             System.out.println("Logon token - "+sLogonToken);

             conn.setRequestProperty("X-SAP-LogonToken", sLogonToken);

             conn.setDoOutput(true);

             conn.setDoInput(true);

             conn.connect();

             if (conn.getResponseCode() != 200) {

                 throw new RuntimeException("Failed : HTTP error code : "

                         + conn.getResponseCode());

             }

             BufferedReader br = new BufferedReader(new InputStreamReader(

                     (conn.getInputStream())));

             String output;

             File f1 = new File("C://test.xls");

             f1.createNewFile();

             FileWriter fw = new FileWriter(f1);

             BufferedWriter bw = new BufferedWriter(fw);

             while ((output = br.readLine()) != null) {

                 bw.write(output);

                 bw.write("\n");

             }

  

             bw.close();

             conn.disconnect();

  

         } catch (MalformedURLException e) {

             e.printStackTrace();

         } catch (ProtocolException e) {

             e.printStackTrace();

         } catch (IOException e) {

             e.printStackTrace();

         }

Former Member
0 Kudos

93306, is it the id of your web intelligence report? I see that you are trying to export the report to excel format. What happens if you export it to any other format?

You may want to refer to the below examples.

http://scn.sap.com/docs/DOC-56658

http://scn.sap.com/docs/DOC-46367

For any queries related to rest please post your queries to the below forum as it is the correct space and you would get better response there.

Thanks,

Prithvi