COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: wdv72 on 19 Apr 2017 01:51:17 AM

Title: Print to PDF button Single Page in Multi-Page tabbed report
Post by: wdv72 on 19 Apr 2017 01:51:17 AM
Hi everyone,

I have created a multi page tabbed report (Cognos 10.2.1: view pages as tabs option). When the report is run it creates all the pages in HTML. They can be browsed by clicking on the report tab created for each report page.

An 'ordinary'  PDF button on one of the reportpages also creates all the other report pages in the PDF.

We would like to add a print-to-PDF button to each single report page which should make it possibe to output only this current report page to a PDF and ignores the other pages.

Hope you can help.
Title: Re: Print to PDF button Single Page in Multi-Page tabbed report
Post by: rteruyas on 20 Apr 2017 09:19:13 AM
Hello @wdv72

This is what I'd try:

The button in of the the pages will call a drill through to the same report but in PDF format.
You'll be passing a parameter called "pPageNumber" to say which page is the one you want to print

Now, for each one of the pages in Cognos there is a property called "render variable". I think a boolean would work with a logic similar to this

((ReportOutput()  = 'PDF') and (PageNumber() = ?pPageNumber?)) or ((ReportOutput() <> 'PDF'))

I havent tested it yet, but hopefully it will require small modification be functional
Hope it helps!
Happy reporting!
Title: Re: Print to PDF button Single Page in Multi-Page tabbed report
Post by: wdv72 on 25 Apr 2017 02:55:21 AM
The default report output is set to PDF. Thought it should work with only (PageName ()=?P_Pagename?) in the boolean render variable.

But I am confronted with an error:

RSV-VAL-0032

The following expression is not valid: PageName ()=?P_Pagename?. If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error occurred at or near the position &#39;12&#39;. The variable named &#39;?P_Pagename?&#39; is invalid.