Links may not function; however, this content may be relevant to outdated versions of the product.
Generating PDFs and attaching them to work objects or viewing them in a web browser
Summary
Process Commander contains seven standard activities that enable you to generate Portable Document Format (PDF) versions of reports or HTML source and either display them in a Web browser or attach them to existing work objects.
- Rule-Obj-ListView.ViewAsPDF
- Rule-Obj-ListView.AttachAsPDF
- Rule-Obj-SummaryView.ViewAsPDF
- Rule-Obj-SummaryView.AttachAsPDF
- @baseclass.HTMLToPDF
- Code-Pega-PDF.View
- Code-Pega-PDF.AttachToWork
The first four activities (Rule-Obj-ListView.ViewAsPDF, Rule-Obj-ListView.AttachAsPDF, Rule-Obj-SummaryView.ViewAsPDF, Rule-Obj-SummaryView.AttachAsPDF) enable you to generate a PDF from a list view or summary view and either display it in your web browser or attach it to a work object.
The last three activities (@baseclass.HTMLToPDF, Code-Pega-PDF.View, Code-Pega-PDF.AttachToWork) enable you to generate a PDF from any HTML source and either display it in your web browser or attach it to a work object.
Creating PDFs to display in a web browser or attaching them to work objects can be used in a number of ways. For example, using an agent rule, you could create a nightly work object that:
- identifies all open assignments
- generates a summary view report grouping all open assignments by operator
- runs the Rule-Obj-SummaryView.AttachAsPDF to generate and attach a PDF to the work object
- emails the work object to a manager for review
Suggested Approach
List View Activities
Rule-Obj-ListView.ViewAsPDF
The Rule-Obj-ListView.ViewAsPDF activity uses data from the list view found on the clipboard to generate a PDF that displays directly in your web browser.
- On the Rule-Obj-ListView.ViewAsPDF activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value DefinitionPageName Required. Enter the name of the list view that will be generated as a PDF. DataPageName Enter the content page of the list view. The content page is located on the Contents tab of the list view rule form. AlternateStream Optional. You can enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
- Click Execute. Using the data found on the clipboard, a PDF of the list view will display in your web browser.
Rule-Obj-ListView.AttachAsPDF
The Rule-Obj-ListView.AttachAsPDF activity generates a PDF of the list view report and then attaches it to a work object based on the pzInsKey given.
- On the Rule-Obj-ListView.AttachAsPDF activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value DefinitionPageName Required. Enter the name of the list view that will be generated as a PDF. DataPageName Enter the content page of the list view. The content page is located on the Contents tab of the list view rule form. AlternateStream Optional. Enter a custom style sheet (CSS) to change the way the PDF displays in the web browser. PDFName Enter the name of the PDF to generate. InsHandle Enter the pzInsKey of the work object the PDF attaches to.
- Click Execute. Using the parameters entered, a PDF of the list view generates and is attached to the work object specified.
Summary View Activities
Rule-Obj-SummaryView.ViewAsPDF
The Rule-Obj-SummaryView.ViewAsPDF activity uses data from the summary view found on the clipboard to generate a PDF that displays directly in your web browser.
- On the Rule-Obj-SummaryView.ViewAsPDF activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value DefinitionPageName Required. Enter the name of the summary view that will be generated as a PDF. DataPageName Enter the content page of the summary view. The content page is located on the Contents tab of the list view rule form. AlternateStream Optional. You can enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
- Click Execute. Using the data found on the clipboard, a PDF of the summary view will display in your web browser.
Rule-Obj-SummaryView.AttachAsPDF
The Rule-Obj-SummaryView.AttachAsPDF activity generates a PDF of the summary view and then attaches it to a work object based on the pzInsKey given.
- On the Rule-Obj-SummaryView.AttachAsPDF activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value DefinitionPageName Required. Enter the name of the summary view that will be generated as a PDF. DataPageName Enter the content page of the summary view. The content page is located on the Contents tab of the summary view rule form. AlternateStream Optional. Enter a custom style sheet (CSS) to change the way the PDF displays in the web browser. PDFName Enter the name of the PDF to generate. InsHandle Enter the pzInsKey of the work object the PDF attaches to.
- Click Execute. Using the parameters entered, a PDF of the summary view generates and is attached to the work object specified.
HTML activities
@baseclass.HTMLToPDF
The @baseclass.HTMLToPDF activity converts a HTML source to a PDF document in the form of a byte array.
- On the @baseclass.HTMLToPDF activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value Markup HTML markup to convert to PDF. StreamName HTML rule stream name (second key part). PDFDocument Enter the name of the PDF that will be generated.
- Click Execute.
Code-Pega-PDF.View
The Code-Pega-PDF.View activity converts a PDF byte array into a HTML source and displays it directly in your web browser.
- On the Code-Pega-PDF.View activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value PDFName Enter the name of the PDF to generate. PDFDocument PDF Document as a byte array.
- Click Execute.
Code-Pega-PDF.AttachToWork
The Code-Pega-PDF.AttachToWork activity converts a HTML source into a PDF document and then attaches it to a work object based on the pzInsKey given.
- On the Code-Pega-PDF.View activity rule form, click Run
to display the Run Rule window.
- In the Run Rule window, enter the appropriate values for the parameters of the activity:
Parameters Value PDFName Enter the name of the PDF to generate. PDFDocument PDF Document as a byte array. InsHandle Enter the pzInsKey of the work object the PDF attaches to.
- Click Execute.
Example
In the following example a Quote Request application allows users to request home insurance premium quotes. A quote object is created for each quote request. A list view report (WorkListView) provides quote request information including the quote ID, quote type, and the date/time the quote object was created.
To generate a PDF of this list view report and display it in your web browser, you need to create an activity that runs the list view report and then converts it to a PDF that displays in your web browser.
- Create an activity that calls the activities needed to run the list view (placing the contents of it on the clipboard), generate a PDF of the list view report, and display it in your web browser.
- On the Steps tab, enter the activity steps that will set the parameters of the list view, run the list view report, and generate a PDF from the list view and display it in your web browser.
- The first activity step sets the parameters for the list view.
- The second activity step calls the Rule-Obj-ListView.ShowView activity which runs the list view and places its contents on the clipboard.
- The third activity step calls the Rule-Obj-ListView.ViewAsPDF activity which converts the list view report into a PDF document and displays it in your web browser.
- Click the Run
button. The Run Rule window displays. Click Execute to run the activity.
- A file download window displays.
- Click Open. The PDF of the list view displays in your web browser.