cognos java api_cognos 调用API生成报表

package com.huawei.sdprpt.report.utils;

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.rmi.RemoteException;

import java.util.Locale;

import sun.misc.BASE64Decoder;

import com.cognos.developer.schemas.bibus._3.AsynchDetailReportOutput;

import com.cognos.developer.schemas.bibus._3.AsynchOptionEnum;

import com.cognos.developer.schemas.bibus._3.AsynchOptionInt;

import com.cognos.developer.schemas.bibus._3.AsynchReply;

import com.cognos.developer.schemas.bibus._3.AsynchReplyStatusEnum;

import com.cognos.developer.schemas.bibus._3.AsynchSecondaryRequest;

import com.cognos.developer.schemas.bibus._3.BaseClass;

import com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub;

import com.cognos.developer.schemas.bibus._3.Graphic;

import com.cognos.developer.schemas.bibus._3.Option;

import com.cognos.developer.schemas.bibus._3.Output;

import com.cognos.developer.schemas.bibus._3.OutputEncapsulationEnum;

import com.cognos.developer.schemas.bibus._3.ParameterValue;

import com.cognos.developer.schemas.bibus._3.PropEnum;

import com.cognos.developer.schemas.bibus._3.QueryOptions;

import com.cognos.developer.schemas.bibus._3.RunOptionBoolean;

import com.cognos.developer.schemas.bibus._3.RunOptionEnum;

import com.cognos.developer.schemas.bibus._3.RunOptionLanguageArray;

import com.cognos.developer.schemas.bibus._3.RunOptionOutputEncapsulation;

import com.cognos.developer.schemas.bibus._3.RunOptionStringArray;

import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;

import com.cognos.developer.schemas.bibus._3.SearchPathSingleObject;

import com.cognos.developer.schemas.bibus._3.Sort;

import com.huawei.bme.commons.util.debug.DebugLog;

import com.huawei.bme.commons.util.debug.LogFactory;

/**

* TODO 添加类的一句话简单描述。

*

* TODO 详细描述

*

* TODO 示例代码

*

*

 
 

*

*

* @author lWX162655

* @version ONIP BME V300R001 2013-7-31

* @since ONIP BME V300R001C00

*/

public class RunReport {

/**

* 运行报表

*

* @param connect

*            报表服务器连接AL

* @param reportSearchPath

*            报表搜索路径

* @param reportType

*            报表类型:1:XLS 2:HTML

* @param parameters

*            报表参数helper

* @return

* @throws IOException

*/

/**

* 调测日志记录器。

*/

private static final DebugLog DEBUGGER = LogFactory

.getDebugLog(RunReport.class);

public String run(CognosLog connect, String reportSearchPath,

String reportType, ParameterValue[] parameters,

String partOfFileoutPutName, String compagers, String savePath)

throws IOException {

String output = null;

if ((connect != null) && (reportSearchPath != null)) {

/*

* 通过reportSearchPath【报表存放路劲】获得报表对象

*/

BaseClass[] reportDomain = getRoportModel(reportSearchPath,

connect.getCMService());

if (reportDomain.length > 0) {

ParameterValue[] emptyParameterValues = new ParameterValue[] {}; // 空参

ParameterValue[] reportParameterValues = null;//

if (parameters != null) {

// 设置报表参数

reportParameterValues = parameters;

}

// 如果传入的参数数组为空则数组为null

if ((reportParameterValues == null)

|| (reportParameterValues.length <= 0)) {

// emptyParameterValues 上面定义的一组空参(执行报表必须要有参数数组,数组内容可为空)

reportParameterValues = emptyParameterValues;

}

// 执行报表

/*

* reportSearchPath:报表存放地址 connect:连接对象

* reportType:报表文件类型(html,excel) reportParameterValues:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值