cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload Crystal report to Business Objects 4.2 using the SDK?

Former Member
0 Kudos

I'm trying to upload a crystal report to Business Objects 4.2. This is my deployer class

ReportDeployer.java

byte[] content= reportTemplate.getContent(); \\ report encoded to base64
CeSession ceSession = null;
CeLoginInfo login = new CeLoginInfo(userName, password, serverName, authType);
try {
        ceSession = CeSessionPool.getInstance().acquire(login);
        IInfoStore infoStore = ceSession.getInfoStore();
        IInfoObjects infoObjects = infoStore.newInfoObjectCollection();
        IInfoObject infoObject;
        infoObject = infoObjects.add(contentType);
        infoObject.setTitle(templateName);
        infoObject.getFiles().addFile(content,"","",rpt.getName(),"");
        infoObject.setParentID(folderID);
        ICommitResult commitResult=infoStore.commit(infoObjects,false, CommitMode.STRICT);
        ICommitErrors  errors = commitResult.getErrors();
        if(errors.size()>0){
            status.setStatusMessage("Error occured while deploying the report :"+errors.get(0).toString());
            status.setStatusType(Status.ERROR);
        }else{
            status.setStatusType(Status.SUCCESS);
            status.setStatusMessage("Successfully deployed the report");
        }
    }

This uploads the report to the BO Server but, it doesn't have the prompts and database configurations. If I right click on the report and select refresh options, report now has the database configurations and prompt fields.

So, am I doing it right?. If yes, how do I refresh the options through SDK?. If this is not how it should be done, can anyone please suggest the best way to upload a report.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member230921
Active Contributor
daniel_paulsen
Active Contributor

Hi Nick

You will need to use the Report plugin (com.crystaldecisions.sdk.pluigin.desktop.report ) and cast the infoobject as an iReport object. from there you can access the Report's IReportRefreshOptions and refresh the object, after committing it to the infostore.

Dan