COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sspk on 08 Feb 2011 02:33:54 AM

Title: Report output in pdf
Post by: sspk on 08 Feb 2011 02:33:54 AM
Hi All,
I have a report which has columns like inv#, Inv amount,PO amt, and so on. Now I have a requirement like when I run the report in html format  , on the cognos viewer if I click a particular Inv#, it should open details about that particular Inv# in PDF format.How can we acheive this.


Thanks & Regards
Title: Re: Report output in pdf
Post by: blom0344 on 08 Feb 2011 05:32:25 AM
Use a second report that fetches the details per invoice and a drill-through definition from the original report to pass the invoice key to the child report. In the drill-through definition you can specify what you want to pass (probably a data item = invoice key) and how the child report should open (as pdf). The child report needs a auto-submit prompt for the invoice key..
Title: Re: Report output in pdf
Post by: sspk on 10 Feb 2011 03:24:02 AM
Thanks blom, Is it possible with out creating a second report and  by defining a drill- thru definition.
Title: Re: Report output in pdf
Post by: blom0344 on 10 Feb 2011 04:00:59 AM
AFAIK the drill-through is designed to pass either parameter values or data-item values (in your case) These are then passed to the accepting parameter. This works for report to report drillthrough. I expect that you cannot reference itself (report) this way.
It is perfectly possible this way to start in HTML and call a PDF subreport. Why would this not suit you?
Title: Re: Report output in pdf
Post by: Lynn on 10 Feb 2011 06:58:01 AM
You can create a drill through definition back to the same report.  It would need to have a parameter to accept the invoice number. It would need to be optional for the scenario you're describing.

Note that if you run the report while working in report studio you must remember to SAVE the report in order to test since it's drilling back to itself.

That said, I'd typically expect that you'd want to show MORE information about the clicked-upon invoice number (or arranged in a more pleasing layout) so having a second report formatted just as you like for the single item makes sense.

Or you could have two containers in one report set so that one renders only for HTML (e.g., showing information for all the invoices) and the other renders only for PDF (e.g., showing details on the desired invoice number).
Title: Re: Report output in pdf
Post by: blom0344 on 10 Feb 2011 08:52:52 AM
Cool Lynn, gonna try this and see if it indeed works..   ;)
Title: Re: Report output in pdf
Post by: Lynn on 10 Feb 2011 09:03:02 AM
Quote from: blom0344 on 10 Feb 2011 08:52:52 AM
Cool Lynn, gonna try this and see if it indeed works..   ;)

You don't BELIEVE ME??  :o

Attached is something I wrote up that uses drill through back to the same report for dynamic column sorting without JavaScript. Someone smarter than me came up with this technique and I just expanded on it and wrote it up.

P.S. Don't tell melee or PaulM who will probably think it is stupid to use out of the box functionality when you can write perfectly good javascript that may break on upgrade
:)
Title: Re: Report output in pdf
Post by: blom0344 on 10 Feb 2011 09:29:40 AM
Among our team we have a standard quote , which,  when translates from Dutch would read:


Cognos, beautiful stuff,  WHEN it works...


Title: Re: Report output in pdf
Post by: Arsenal on 10 Feb 2011 09:44:50 AM
Quote from: Lynn on 10 Feb 2011 09:03:02 AM
.

P.S. Don't tell melee or PaulM who will probably think it is stupid to use out of the box functionality when you can write perfectly good javascript that may break on upgrade
:)

What do you mean "may"? It WILL in all likelihood
Title: Re: Report output in pdf
Post by: melee on 10 Feb 2011 10:26:46 AM
I'll have you all know that all of my 8.3 reports successfully made it to 8.4.1 without ANY problems whatsoever!














There was only one