Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How can I export Oracle BI publisher report in real Excel format(not .xls, but content is html)?

Received Response
164
Views
6
Comments
Service Desk-93159
Service Desk-93159 Rank 1 - Community Starter
edited Jun 6, 2024 7:38AM in Oracle Analytics Publisher

Summary

How can I export Oracle BI publisher report in real Excel format(not .xls, but content is html)?

Content

I use this java code to export  BI publisher report in Excel format, I would like to get real Excel file, but I got .xls that content is html.

ReportRequest reportRequest = new ReportRequest();

            reportRequest.setReportAbsolutePath("/XXXX/XXXX/XXXXXPROD/REPORT/HPTGAT008R20 - xxxxxxxxxxxxxxxx.xdo");

            reportRequest.setAttributeTemplate(template);

            reportRequest.setAttributeFormat("excel");

            reportRequest.setAttributeLocale("en-US");

            reportRequest.setSizeOfDataChunkDownload(-1);

            ParamNameValues paramNameValues = new ParamNameValues();

            paramNameValues.setListOfParamNameValues(arrayOfParamNameValue);

            reportRequest.setParameterNameValues(paramNameValues);

            ReportResponse repResponse = new ReportResponse();

            repResponse = reportService.runReport(reportRequest, username, password);

            byte[] baReport = repResponse.getReportBytes();

            FileOutputStream fio = new FileOutputStream("C:\\TestReportForamt.xls");

            fio.write(baReport);

            fio.close();

report_output_format.jpg

 

Could you advise me or provide sample java code to export BI publisher report in real Excel format?

Answers

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello,

    Could you please provide you´re bip version?

    final String outFormat = "xlsx";reportRequest.setAttributeFormat(outFormat);

    and you do not need to add the extension in the file name, otherwise you´ll get e.g.: fileNamepdf.pdf 

    Regards,

    Carlos

    I tested in 12.2.1.3.0.

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    BTW, are you able to successfully run it in soapUI?

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello,

    Please confirm: can you run that report in BIP and output as excel?

    image

    Regards,

    Carlos

  • Service Desk-93159
    Service Desk-93159 Rank 1 - Community Starter

    I try to set AttributeFormat is "xlsx" but I got error as below,
    Note: BI Publisher 12.2.1.2.0

    SEVERE: Error while invoking endpoint http://192.168.111.93:9502/xmlpserver/services/v2/ReportService from client; ServiceName: {http://xmlns.oracle.com/oxp/service/v2}ReportService ; PortName: {http://xmlns.oracle.com/oxp/service/v2}ReportService ; Client side features: [weblogic.jws.jaxws.client.ClientIdentityFeature]; Client side policies:
    com.sun.xml.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: oracle.xdo.webservice.exception.OperationFailedException: PublicReportService::generateReport failed: due to File type not supported: xls Please see the server log to find more detail regarding exact cause of the failure.
    at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:193)
    at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:136)
    at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
    at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:205)
    at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:292)
    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
    at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
    at com.sun.proxy.$Proxy50.runReport(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:147)
    at com.sun.proxy.$Proxy51.runReport(Unknown Source)
    at utilities.report.HPTReportObiAllFormatUtility.callRunReport(HPTReportObiAllFormatUtility.java:278)
    at utilities.report.HPTReportObiAllFormatUtility.main(HPTReportObiAllFormatUtility.java:339)

  • ManikantaRendla
    ManikantaRendla Rank 1 - Community Starter

    Dear,

    Did you get any solution for the above problem..?

    Could you please let me know..!

  • [Deleted User]
    [Deleted User] Rank 5 - Community Champion

    @ManikantaRendla You are posting into a thread that's almost 7 years old. Please open your own thread and state your question and issue clearly and with all pertinent details. Full version number, full product name, screenshots, code examples, error messages if applicable etc.

    This way you can manage incoming replies which is not possible in an existing, abandoned, thread.