0

当我在 oracle Bi 报告 v12c 中调用 Oracle Bi 服务中的 runReport 时,返回 byteArray 为空!请帮助我 !

我的代码:

public static void main(String[] args) {
    ReportService_Service reportService_Service = new ReportService_Service();
    ReportService reportService = reportService_Service.getReportService();

    ReportRequest reportRequest = new ReportRequest();
    reportRequest.setAttributeFormat("pdf");
    reportRequest.setAttributeLocale("en-US");
    reportRequest.setAttributeTemplate("Simple");
    reportRequest.setReportAbsolutePath("/Ehsan/HrEmployeeReport.xdo");
    ParamNameValues allParam = new ParamNameValues();
    ArrayOfParamNameValue pNameValue = new ArrayOfParamNameValue();
    ParamNameValue nameValue = new ParamNameValue();
    nameValue.setName("salParam");
    ArrayOfString aos = new ArrayOfString();
    aos.getItem().add("13000");
    nameValue.setValues(aos);
    pNameValue.getItem().add(nameValue);
    allParam.setListOfParamNameValues(pNameValue);
    reportRequest.setParameterNameValues(allParam);
    try {
        File newFile = new File("D:/a/b.pdf");
        FileOutputStream fos = new FileOutputStream(newFile);
        ReportResponse response = new ReportResponse();
        response = reportService.runReport(reportRequest, "weblogic", "weblogic1");
        System.out.println(response.getReportContentType());
        System.out.println(response.getReportFileID());
        System.out.println(response.getReportBytes().length);
        fos.write(response.getReportBytes());
        fos.close();
    } catch (Exception e) {
        e.printStackTrace();
    }

}

输出 :

  1. 申请/pdf
  2. xmlp4736064089125233107tmp
  3. 0
4

1 回答 1

0

尝试添加:

reportRequest.setSizeOfDataChunkDownload(-1);

在你的代码中。

于 2018-11-22T10:09:18.377 回答