Skip to main content

Export Data Page (list) to Excel Sheet


Step-by-step guide for exporting a Data Page list to an Excel file using Platform 8.8.2:

  1. Generate a Data Page list.

  • In this illustration, a report definition is utilized as a source to query sample data inputted in the Data Type record. 


2. Create an Excel template file (see a sample attached)
  • Reference the data page name and pxResults() followed by a property name.

  • Notice that we can stye the Excel template file such as adding a color to the header.  Column D is also set with 'Wrap text'.

NoteIt seems that the Excel template does not support parameterized data pages. One potential solution is to utilize a Page-Copy step to copy data from the parameterized data page to a temporary activity page, which can then be employed in the Excel template. For example: {MySampleDataTypeListFiltered.pxResults().pxCreateDateTime}.

3. Upload the Excel template file as a binary file in Platform.

4. Create an activity with one step - Call pxGenerateExcelFile

  • Parameter 1 = Excel output file name
  • Parameter 2 = Excel template name ("excel!SampleDataTypeDataPage!xlsx")
  • Parameter 3 = Select DownloadFile checkbox

5. (Unit test) Run the activity to generate and download the Excel output file.



Attach Excel file to email

If you have a requirement to send this Excel file as an email attachment, this article demonstrates how to configure it step by step.


Happy Learning :) :)

Comments

Popular posts from this blog

Understanding the Lock Mechanism in Pega

Now, let's delve into the Pega lock mechanism. To begin, Pega employs both database-level locks, which are of shorter durations (usually in milliseconds), and Pega-level locks, which extend over more extended periods (determined by user operations, often a few minutes). While you have the option to disable Pega-level locks using the Optimistic locking strategy (discussed later), database-level locks cannot be turned off; they are an integral part of the infrastructure layer. Moving forward, I'll elaborate on Pega-level locks. 1. Fundamentals of Pega-Level Locks When an individual initiates an assignment, the system transitions the state to "Perform" mode and acquires a lock. This lock data is then added to the "PR_SYS_LOCKS" table in the database, where it is systematically managed. Throughout this phase, no other user can access the same assignment. Upon the user's submission or cancellation of the assignment, the state shifts to "Review" mode...

How to set up JFrog Artifactory as a Repository in Pega.

Before delving into the topic, let's gain some understanding of what a repository is........... What is a repository? A repository is a centralized storage location where data, files, documents, or other digital assets are stored and managed. It serves as a single source of truth for organizing, versioning, and accessing these assets.  In the context of software development, a repository typically refers to a version control system, where developers store and manage source code, configuration files, documentation, and other project-related files. Version control systems like Git, Subversion (SVN), and Mercurial are commonly used repositories in software development. In addition to version control systems, repositories can also refer to databases, file systems, content management systems (CMS), or any other structured storage system used to manage digital assets. Overall, a repository provides a structured and organized way to store and manage digital assets, facilitating collaborat...

Building a CSV File Download Function from a Page List

Consider a scenario where we want to download recently added table data from the screen into a CSV format for analysis. Today, we will explore how to accomplish this in Pega. An existing out-of-the-box activity named "pxConvertResultsToCSV" is available in the @baseclass, and you can utilize it without the need to create it from the ground up. The following example illustrates a sample screen: when the button is clicked, the Page List data on the screen is downloaded as a CSV file to the end user's local machine. 1.To begin, establish a Page List property. In this instance, I defined a Data class, "MyCo-Data-Item," and subsequently generated a Page List named "ItemList" in the Work class, referencing the Item class. 2.Position a table that references the Page List, and configure it to be inline-editable, allowing the addition of records directly from the screen. Additionally, position a button in close proximity to the table. 3.Configure the button by ...