Java Oracle BI报表服务返回0大小字节数组

Java Oracle BI报表服务返回0大小字节数组,java,oracle,oracle-bi,Java,Oracle,Oracle Bi,当我在Oracle Bi report v12c中调用Oracle Bi服务中的runReport时,返回的byteArray为null!!!请帮帮我 我的代码: public static void main(String[] args) { ReportService_Service reportService_Service = new ReportService_Service(); ReportService reportService = reportService_

当我在Oracle Bi report v12c中调用Oracle Bi服务中的runReport时,返回的byteArray为null!!!请帮帮我

我的代码:

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();
    }

}
输出:

  • 申请表格/pdf
  • XMLP473606408912533107TMP
  • 0
  • 尝试添加:

    reportRequest.setSizeOfDataChunkDownload(-1)


    在您的代码中。

    我的文件是0字节大小!!!我只是想澄清一下——你说的是BI出版商,而不是“OBI”