If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

URL to download PDF output - Not Cog Viewer

Started by JCarter, 02 Sep 2021 02:03:29 PM

Previous topic - Next topic

JCarter

Hi all,

I'm wondering if anyone might have a thought as to what I'm doing wrong, using a URL to directly download PDF output.

We're on 11.1.7 FP3.

I have a customer who needs to download a report directly, via an automated system process.
We have SSO setup, his system has its own certificate (client certificate provides the info for SSO), and that all works fine.

I'm trying to craft a URL syntax for his system to use, to run a report in PDF format, which then is downloaded by his system.

No matter what I do though, the URL just shows the PDF inside the Cognos Viewer instead of returning the actual PDF file itself.

I have a ticket open with IBM, but they've been working on it for several weeks, giving me suggested URL syntax which seems to work for them, but doesn't work for me. I've tried the 4 major browsers with identical behavior from them all (IE, Edge, Chrome, Firefox).

I've done lots of online searching as well, coming up with plenty to read, but nothing that makes this work.

Any suggestions of anything else to try or some config option you know of that I could check?

https://<Cog URI>/bi/?pathRef=.public_folders%2FAdministration%2FPDF%2BDownload&format=PDF&Download=true&b_action=xts.run&prompt=false

https://<Cog URI>/bi/v1/disp?b_action=xts.run&m=portal/download.xts&m_download_obj=storeID("i7540A4CC4E9441E4AA929F73B0D17068")&format=PDF&m_name=PDF%2BDownload

Thanks

JCarter

I'm still struggling with this.

We're now on 11.1.7 FP4 IF8 if that matters.

My latest try is to use the outputEncapsulation to just get a URL returned that I can then hit to get the direct download, but I'm not sure where to find the returned URL.

https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=components-starting-cognos-viewer
Quoterun.outputEncapsulation
Specifies how output documents in the response are encapsulated. Acceptable values are HTML, URL, URLQueryString, none.

https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=sets-outputencapsulationenum
QuoteURL
Specifies that a URL should be returned.

When this value is specified, the output will be cached on the server and a URL referencing the cached output will be returned.

https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=sets-runoptionenum#bibus_runOptionEnum__outputEncapsulation
QuoteSpecifies whether the server returns output documents in the response, or caches them in the user's session object and returns a reference to the documents instead.
To use this option, the report output must be returned in the SOAP response. For this to occur, the value of the saveAs option must be unspecified and the values of the following options must be false:
archive
email
print
saveOutput

Based on that, I tried several URLs like:
https://<Cog URI>/bi/v1/disp?b_action=cognosViewer&ui.action=run&ui.object=/content/folder[@name='Administration']/report[@name='PDF Download']&run.outputFormat=PDF&run.prompt=false&run.outputEncapsulation=URL&run.archive=false&run.email=false&run.print=false&run.saveOutput=false

The Cognos Viewer comes up and displays the PDF. Exploring through headers and responses in Chrome's F12 screen, I couldn't find anywhere that it provided a link to the PDF itself.
There's even a "Download" icon in the viewer, but the viewer hides the destination of it so I can't even find it in the raw HTML.

If you have any thoughts or suggestions, I'd appreciate them.
Thanks


dougp

I don't know of a way to do what you want directly, using only a URL.

Looking at the document outline, it's clear that those links refer to the Cognos SDK.  That information must be used in the context of an application that uses the Cognos SDK.  That will involve several round-trips to the server, the first being about authentication.

You could also do this using Cognos Mashup Service (CMS), but that would involve the same complexity.

SDK and CMS apps can be written in various programming languages.  IBM's documentation includes Java and C#.