Converting section into pdf


can anyone guide me how to convert the section containing report into pdf or excel by clicking on a button.


Shweta V Singh.

***Updated by moderator: Lochan to add Categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.


Keep up to date on this post and subscribe to comments

March 22, 2018 - 9:10am


can you check the activity  rule "pxCreatePDF " part of class "work-".  It Generates the PDF of the section and attaches it to Work Object.

March 22, 2018 - 9:24am


we can also add the section into a html rule and then can use the "pyAttachAsPDF" or else "HTMLTOPDF" activity. to add the section in html use the below code.

<pega:include name="SectionName" type="Rule-HTML-Section"/>


March 22, 2018 - 10:17am

HI Shweta,

If you grid is sourced with the report definition then you can look into my use case to add a export link in your section to export the data into excel. If your grid is sourced with page list then in the activity you can use the page list instead of report definition as source of data.

Hope this helps you.



March 23, 2018 - 1:34am
Response to Mahesh Midthuru


I have applied your steps in my usecase but the things is my report definition properties are different . Iam attaching a screen shot please have a look on it. How should i add those properties in CSVProperties column in activity while calling Call pxConvertResultsToCSV. py|ID is working fine.  If iam adding other propeties same as report definition as it is in the CSVProperties column then it is displaying error "invalid expression"

 Please guide me for the same how to add my report definition properties in my usecase. 



Shweta V Singh.

March 23, 2018 - 3:58am
Response to SHWETAS7

Can you run your report and expand the pyReportContentPage > pxResults > pxPages and show the output of your clipboard data as i would like to see the output of your report definition. Also show the Data access tab configuration of your report definition.

March 24, 2018 - 12:55am

see i have used this soln for my above posted question: 

firstly i run the report by calling Call Rule-Obj-Report-Definition.pxRetrieveReportData. 

Then it asks for parameters: pyReportName: my report definition name i mentioned, pyReportClass: my report definition class name in which i have created my report, pyPageName: here we have to mention the page name which we have to define in pages and classes tab of class Code-Pega-List. In my case , the page name i set in pages and classes tab  is Report with class Code-Pega-List.

Code-Pega-List will retrieve list of all records. Run this activity, once you get the correct execution of this step.

Then to export to pdf : Call pzViewExportToExcel then it asks for PrimaryPageName: PageName.pyReportDefinition. In my case it is Report.pyReportDefintion.




Shweta V Singh.