Cognos Analytics

Cognos Analytics

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

 View Only
Expand all | Collapse all

Support for Database images in a Cognos Reports

  • 1.  Support for Database images in a Cognos Reports

    Posted Mon March 15, 2021 03:50 PM
    We have images stored in Oracle Database as "varbinary" datatypes. Image could be JPEG, JFIF, PDFs..

    We would like to display the images in a Cognos list report, is this supported?

    Any idea how to make this happen?

    We have Cognos 11.1.6

    #CognosAnalyticswithWatson


  • 2.  RE: Support for Database images in a Cognos Reports

    Posted Tue March 16, 2021 09:44 AM
    You would have to employ an external application to retrieve the image data from the database and stream it as an image. Then it's a simple matter of constructing an image with a dynamic URL which has a parameter for which image to retrieve. A long time ago in a past life I've done this as a Java HTTP servlet application and have some code I could share. It does require an application server, such as Apache, to run in. IBM obviously doesn't recommend running it in the Websphere Liberty that Cognos runs in but it might be possible to do it.

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



  • 3.  RE: Support for Database images in a Cognos Reports

    Posted Tue March 16, 2021 10:56 AM
    Hi @Robert Hofstetter

    Thank you for your reply. would appreciate if you could share the code.

    Do you know if the same is possible simply by using JavaScript?


  • 4.  RE: Support for Database images in a Cognos Reports

    Posted Tue March 16, 2021 12:52 PM
    You could use JavaScript from an extension  to render the binary content as it is inside the oHostcontrol. Rendering images with JS is quite straight forward. I think this could be feasible. PDF ... I don't know.

    ---
    .... sent from mobile ... excuse my brevity.





  • 5.  RE: Support for Database images in a Cognos Reports

    Posted Tue March 16, 2021 01:16 PM
    Hi @Ralf Roeber,

    Thank you for your reply, this sounds promising....
    do you have an example code/extensions?​

    Thanks!


  • 6.  RE: Support for Database images in a Cognos Reports

    Posted Mon March 22, 2021 09:48 AM
    Edited by System Admin Fri January 20, 2023 04:38 PM

    Original Message:
    Sent: Tue March 16, 2021 01:15 PM
    From: Richard Mabjish
    Subject: Support for Database images in a Cognos Reports

    Hi @Ralf Roeber,

    Thank you for your reply, this sounds promising....
    do you have an example code/extensions?​

    Thanks!
    Original Message:
    Sent: Tue March 16, 2021 12:51 PM
    From: Ralf Roeber
    Subject: Support for Database images in a Cognos Reports

    You could use JavaScript from an extension  to render the binary content as it is inside the oHostcontrol. Rendering images with JS is quite straight forward. I think this could be feasible. PDF ... I don't know.

    ---
    .... sent from mobile ... excuse my brevity.



    Original Message:
    Sent: 3/16/2021 9:44:00 AM
    From: Robert Hofstetter
    Subject: RE: Support for Database images in a Cognos Reports

    You would have to employ an external application to retrieve the image data from the database and stream it as an image. Then it's a simple matter of constructing an image with a dynamic URL which has a parameter for which image to retrieve. A long time ago in a past life I've done this as a Java HTTP servlet application and have some code I could share. It does require an application server, such as Apache, to run in. IBM obviously doesn't recommend running it in the Websphere Liberty that Cognos runs in but it might be possible to do it.

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

    Original Message:
    Sent: Mon March 15, 2021 03:50 PM
    From: Richard Mabjish
    Subject: Support for Database images in a Cognos Reports

    We have images stored in Oracle Database as "varbinary" datatypes. Image could be JPEG, JFIF, PDFs..

    We would like to display the images in a Cognos list report, is this supported?

    Any idea how to make this happen?

    We have Cognos 11.1.6

    #CognosAnalyticswithWatson


  • 7.  RE: Support for Database images in a Cognos Reports

    Posted Wed March 24, 2021 09:06 AM
    Good Morning,

    You should first go to Framework Manager and set the data item to binary large object (BLOB) datatype.  Then you have to adjust the properties of the FM it to display the image in the reports.

    Warm Regards,
    Eli





  • 8.  RE: Support for Database images in a Cognos Reports

    Posted Mon March 22, 2021 09:58 AM
    Edited by System Admin Fri January 20, 2023 04:15 PM
      ******* Cognos users PLEASE VOTE for this RFE  *********

    Please see link below to vote for this much needed functionality to be added to Cognos Analytics.

    Thanks!

    https://ibm-data-and-ai.ideas.aha.io/ideas/CA-I-3144






  • 9.  RE: Support for Database images in a Cognos Reports

    Posted Tue March 30, 2021 11:09 AM
    Rich,

    I can't seem to vote on it for some reason or I would. I don't think JS will work for PDF output so you may still have to consider my original suggestion. I've attached example code of a very rudimentary Java servlet I used long ago in a past life. I think I used this way back around v8.3. I'm not at all sure why they don't accept a properties file as valid so I had to add the text extension on that one just to upload it. I of course have lost the simple document I had put together on how to implement it.

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

    Attachment(s)

    java
    getblob.java   5 KB 1 version
    txt
    jdbc.properties.txt   227 B 1 version


  • 10.  RE: Support for Database images in a Cognos Reports

    Posted Wed March 31, 2021 04:04 AM
    HI Richard, 
    as suggested by Elihu El i have used this properties in the past.

    check also this link,maybe could help.
    https://www.cognoise.com/index.php?topic=7673.0
    Regards



    ------------------------------
    Leonardo Russo
    ------------------------------



  • 11.  RE: Support for Database images in a Cognos Reports

    Posted Wed March 31, 2021 05:27 AM
    There is an RFE on this
    https://ibm-data-and-ai.ideas.aha.io/ideas/CAOP-I-1638

    ------------------------------
    Leonardo Russo
    ------------------------------