COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: irvingbos on 02 Sep 2016 08:57:27 AM

Title: using jsPDF and/or HTML2Canvas
Post by: irvingbos on 02 Sep 2016 08:57:27 AM
Hi, i am trying to build button which will allow user to PDF a given chart. Looking at using HTML2Canvas to grab part of the screen, then use jsPDF to write it to a PDF. It partially works, but always getting image chopped, and a black background in the PDF.

Anyone have experience doing this in a Cognos report?

thanks.
Title: Re: using jsPDF and/or HTML2Canvas
Post by: AnalyticsWithJay on 02 Sep 2016 12:09:12 PM
There's a much simpler solution in my opinion which involves no code.

1. Create a drill through on the text, which drills to this same report.
2. Create a second page on the report that has a render variable. The page only renders when accessed through the drill through.
3. On the drill through properties, set the run format to PDF.
4. Place a copy of the chart on this second page.

Note: You'll need to set render variables on your other report pages so they only render when it's not accessed via drill through.

Jay