Question
Verizon India
IN
Last activity: 13 Apr 2020 12:33 EDT
Generating a pdf for a report on Button click
Hi,
I have a requirement to generate a pdf on the click of a button for a report which is there on that particular section. I am a newbie could anyone guide me through step wise.
Thanks
***Edited by Moderator: Pallavi to update platform capability tags***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
There is an OOTB option that is available in Reports to Export to PDF.
When we open a report from the report browser and on the top, in the actions menu, we can find an option to "Export to PDF".
Please find the below screenshot for more details.
Are you using custom section to display the report?
Verizon India
IN
Hi Kanap,
Thanks for the response but I'm doing this on a custom section.
Pegasystems Inc.
IN
Hello Rachit,
For that button, configure refresh this action for click event with pxCreatePDF activity as pre-activity. For pxCreatePDF activity, pass your custom section as a parameter along with other required parameters.
Regards,
Praveen
Verizon India
IN
Hi Praveen,
Thanks for the solution, but I got stuck at the later part of the activity. It further calls an activity "pyAttachAsPDF" which is failing as I do not know what exactly to pass in the parameters HTMLStream and InsHandle,
A bit of detailed help would be appreciated.
Thanks and Regards
Rachit Mathur
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
InsHandle is the pzInsKey of the case which is passed from pxCreatePDF and HTMLStram param is set in pxCreatePDF as pzCreatePDFHarnessWrapper.
Pegasystems Inc.
IN
Create a HTML rule with below code.
<pega:include type="Rule-HTML-Seaction" name="<YOUR SECTION NAME>" />
Now you have to pass this HTML rule name to HTMLStream parameter and pzInsKey of the current workobject (i.e. for which WO you have to attach generated PDF) to InsHandle.
Regards,
Praveen
-
Rachit Mathur
Verizon India
IN
Hey Praveen,
Following your trail, I reached at what all you explained. Now my activity is failing and when I check with the tracer, the step 3 of activity "AttachAsPDF" is the cause. The error i'm getting is "Unable to open an instance using the given inputs: pyClassName = History-Data-Portal "
To what I observed is there is a mandatory parameter "PDFDocument" in step 3 of activity "AttachAsPDF", which I am not passing.
Thanks
Pegasystems Inc.
IN
Hello Rachit,
After passing all required parameter, is PDF was generated as expected?
Regards,
Praveen
Verizon India
IN
No, nothing happens. When I run the tracer and check I find what I mentioned in the above reply. What am I supposed to pass in PDFDocument parameter.
Pegasystems Inc.
IN
Hello Rachit,
Is your Button's section and PDF section in same class?
If not, then save as the PDF section into Button's section class then verify the behavior.
Otherwise, please share a detailed document with screen prints.
Regards,
Praveen