Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Request for Help: Running a Job to Produce Report Outputs in JSON Format

    Posted Tue April 22, 2025 10:14 AM
      |   view attached
    Hello Cognos Community,
    I'm reaching out for assistance with IBM Cognos Analytics 12.0.4. I'm trying to run a job to produce report outputs, but the available formats are limited to HTML, Excel Data, PDF, CSV, Excel, and XML. I'm wondering if there's a way to produce reports in JSON format.
    Has anyone successfully configured Cognos to output reports in JSON format? If so, could you please share your experience or point me in the direction of relevant documentation?
    I'd greatly appreciate any guidance or advice on how to achieve this.
    Best regards,
    Sergio.


    ------------------------------
    Sergio Soares
    SSS
    Campinas
    ------------------------------


  • 2.  RE: Request for Help: Running a Job to Produce Report Outputs in JSON Format

    Posted Wed April 23, 2025 03:24 AM

    Cognos does not support JSON natively. You would have to write a postprocessor script/program to convert one of the formats (e.g. XML) to your desired json format.

    If Cognos is configured to output to the server filesystem, you could set your script to run automatically whenever a report output gets generated. 



    ------------------------------
    Tomáš Polakovič
    ------------------------------



  • 3.  RE: Request for Help: Running a Job to Produce Report Outputs in JSON Format

    Posted Fri April 25, 2025 09:50 AM

    You can't produce JSON format as an output directly, but there is an option to do it when writing custom Mashup code: https://www.ibm.com/docs/en/cognos-analytics/12.1.0?topic=service-output-formats. Mashup is the original REST based SDK option that has existed since version 10. Depending on your goal of using the JSON output this might be an option for you.



    ------------------------------
    Robert Hofstetter
    ------------------------------



  • 4.  RE: Request for Help: Running a Job to Produce Report Outputs in JSON Format

    Posted Wed April 30, 2025 09:43 AM
      |   view attached

    As others have mentioned you can use Mashup. Actually, it can be pretty straightforward.

    Assume, you have a simple List report with a searchPath: "content/folder[@name='DEV']/folder[@name='Test']/report[@name='rep-json']"

    Then you can use an RDS URL to get its output in JSON:

    http(s)://<cognos_server>/ibmcognos/bi/v1/disp/rds/pagedReportData/searchPath/content/folder[@name='DEV']/folder[@name='Test']/report[@name='rep-json']?fmt=JSON&selection=List1&v=3

    Modify the URL to match your Environment.

    You can find relevant Mashup examples and docs at:

    https://community.ibm.com/community/user/blogs/steven-macko/2017/01/16/how-to-use-ibm-1022-cognos-mashup-service-cms-samples-in-ibm-cognos-analytics-11

    https://www.ibm.com/docs/en/cognos-analytics/12.1.0?topic=developer-cognos-mashup-service-samples

    I've attached my report spec and JSON output.



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------

    Attachment(s)

    zip
    rep-json.zip   2 KB 1 version