cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving Webi report size using BO XI SDK

Former Member
0 Kudos

Hi,

How do I retrieve the size of the BO Webi report using BO XI SDK? I am migrating a java application from BO 6 to BO XI, and in the existing code WIDocument.getDocSize() is used to retrieve the report size. What is the equivalent of this in BO XI?

Thanks,

Subham

Accepted Solutions (1)

Accepted Solutions (1)

dan_cuevas
Active Participant
0 Kudos

Hi Subham,

If you are looking for the size of the WID file, you can get this through the InfoObject.

Please note that this WID file only changes if the WebI document was actually saved.

Below is a sample code snippet that will retrieve the file size from an InfoObject:


IInfoStore boInfoStore = (IInfoStore) boEnterpriseSession.getService("InfoStore");
                                    
String query = "SELECT SI_FILES FROM CI_INFOOBJECTS WHERE SI_INSTANCE='false' AND SI_NAME='" + webiDoc + "'";
IInfoObjects boInfoObjects = boInfoStore.query(query);
if (boInfoObjects.size() > 0) {
     IInfoObject boInfoObject = (IInfoObject) boInfoObjects.get(0);
                                                
     IFiles boFiles = boInfoObject.getFiles();
     IFile boFile = null;
     for (int i=0; i<boFiles.size(); i++) {
         boFile = (IFile) boFiles.get(i);
         out.print(boFile.getName() + ": " + boFile.getSize() + "<BR>");
     }
} else {
      out.print("No WebI document found!");
}

Hope this helps.

Regards,

Dan

Answers (1)

Answers (1)

ted_ueda
Employee
Employee
0 Kudos

What are you going to use the size for?

If what you want to do is get a binary format of the document, then specify the size when streaming out (in content-length), you'd likely use BinaryView.getContentLength() with the ReportEngine.

Sincerely,

Ted Ueda