cancel
Showing results for 
Search instead for 
Did you mean: 

How to send/Copy reports from BI launch Pad Inbox to File Server

Former Member
0 Kudos

Hello Friends,

I am able to schedule Webi and Crystal reports to BI Launch pad INBOX, now I am trying to send/ copy reports from BI Launch pad to some Server.

How can it be done? Do we have any examples?

Please let me know.

Regards,

Rakhy.

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

I don't think it can be done automatically with reports in the Inbox.  However, if you include the option to "Keep an instance in the history" as part of your schedule to inbox, you could potentially open the instance from History in code.

If you're scheduling to a PDF format, you could just download the file and save it.  If it's not in PDF format you would have to have two separate code paths for the export - one for Webi reports that uses the RESTful web service to get a PDF export of the report and another for Crystal reports that loads the instance into a ReportDocument and exports it.

The other option is to schedule the report twice - once to Inbox and once to a File destination.

-Dell

Former Member
0 Kudos

Hi Dell,

I am able to keep an instance in the history while scheduling reports to Inbox and it is in PDF format as well.

So you are saying I can open the instance from history? Please correct me if I am wrong here.

Reagrds,

Rakhy.

Former Member
0 Kudos

Hi Rakhy,

There are multiple ways how you can do it. Let me explain the steps below

1. Login to enterprise

2. Query to infostore to get the inbox id for a user.

3. Again query the infostore to retrieve the pdf instance from the user inbox.

4. Use IFiles interface to send/export the instance to disk.

Below is the snippet code

================================================

IInfoObjects instances = iStore.query("select * from ci_infoobjects where si_id=<report id in the inbox> and SI_KIND='PDF'");

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

  {

   IInfoObject iReport=(IInfoObject)instances.get(i);

   IFiles files = (IFiles)iReport.getFiles();

   IStreamingDownloadFile iStream = ((IRemoteFile)files.get(0)).getStreamingDownloadFile(0);

   iStream.openFile();

   BufferedOutputStream pw = new BufferedOutputStream(new FileOutputStream("C:\\Sample.pdf",false));

   while(iStream.hasNextChunk())

   {

    pw.write(iStream.nextChunk());

   }

   pw.flush();

   pw.close();

   iStream.closeFile();

   out.print("<br>done");

  }

=====================================================

Thanks,

Prithvi

DellSC
Active Contributor
0 Kudos

Yes, that's exactly what I'm saying.  If you have the instance in the public folders, you don't necessarily need to go to the inbox to get it.

-Dell

Former Member
0 Kudos

Thanks Prithvi,

With your snippet code I am able to send reports from BI Launch pad INBOX to local server.

Regards,

Rakhy.

Former Member
0 Kudos

Thanks Dell for your suggestion, but client requested to send reports from inbox as they don't have control on instances.

Regards,

Rakhy.

Former Member
0 Kudos

Hello Pritvi/Dell,

I have one more question. I am trying to send only unread reports from BI Launch pad Inbox to Server, once the task is complete I need to mark that report as read.

Can you guys please suggest me on this as well?

Regards,

Rakhy.

Former Member
0 Kudos

Unfortunately there is no way to figure out whether a report in inbox is unread using the sdks as far as I know.

Thanks,

Prithvi

DellSC
Active Contributor
0 Kudos

Rakhy,

You might want to try running a couple of queries in QueryBuilder to see if there's an obvious property available for this.

1.  Get the SI_ID value of a user's Inbox (in the CMC, find the inbox, righ-click on it, and go to Properties) where you know that there are both read and unread items.

2.  Run the following query:

Select * from CI_INFOOBJECTS where SI_PARENTID = <the SI_ID value from step 1>

Look through all of the properties to see if there's something there that will indicate whether the report has been read.  I don't guarantee that it's there, but this is the type of process I follow when I'm looking for various properties.  In your code, you'll include this field in  the CMS query and you'll most likely have to access it through the properties of the IInfoObject.

-Dell

Former Member
0 Kudos

Thanks Dell/Prithvi for your suggestions.

Once I copied files from Inbox to server, I am able to set inbox reports as read using below code.

boInfoObject.setMarkedAsRead(true);

  infoStore.commit(boInfoObjects);

This resolves my purpose for now.

Regards,

Rakhy.

Former Member
0 Kudos

Hi Prithvi and Dell,

I found another solution to check if the report is read or not in INBOX.  This is at query level.

String inboxQuery = "SELECT SI_ID, SI_NAME, SI_FILES, SI_MARKED_AS_READ FROM CI_INFOOBJECTS WHERE SI_PARENTID = " + inboxID +

  " AND (SI_MARKED_AS_READ  IS NULL OR SI_MARKED_AS_READ = 0) ";


With the above query I will get reports which are unread .


Regards,

Rakhy.

Former Member
0 Kudos

One more question,

As you guys know I am scheduling reports to INBOX, if report fails for some reason I would like to re run the report for couple more times.

InCMC, under Schedule -> Recurrence I see Number of reties allowed field. Can we set value to that field so that report will rerun if it fails?

Please let me know your thoughts on it.

Ragards,

Rakhy.

DellSC
Active Contributor
0 Kudos

I haven't done this, but I would take a look at the properties of ISchedulingInfo to see whether you can do it there or if you have to access the property through IProperties.

-Dell

Former Member
0 Kudos

Use the method void setRetriesAllowed(int newVal) from the ISchedulingInfo interface.

Thanks,

Prithvi

Former Member
0 Kudos

Thaks Prithvi and Dell for your suggestions. I will use setRetriesAllowed(int newVal) from the ISchedulingInfo interface.

Regards,

Rakhy.

Former Member
0 Kudos

Hello Prithvi/Dell,

How to avoid optional prompts while setting prompt values to the reports? Please let me know your thoughts on it.

I already posted as separate discussion at

Regards,

Rakhy.

Answers (0)