Power Apps Print Function [With Various Examples]

Printing in Power Apps used to need a lengthy workaround, but it is now much easier. In this Power Apps Tutorial, we will learn about Power Apps Print() function and we will also discuss how to work with the print function based on different scenarios.

Recently, we got a requirement while working with one of our close clients. They asked to print a screen while working with the Power Apps canvas app.

Here, we will do an in-depth discussion on what is Power Apps Print() and how to work with this function based on different scenarios. Such as:

  • Power Apps Print function limitation
  • Power Apps Print Screen Template
  • Power Apps Print screen
  • Power Apps Print screen to PDF
  • Power Apps Print screen by button click
  • Power Apps Print form
  • Power Apps Print Gallery
  • Power Apps Print background effect

Before working with the Power Apps Print function within a canvas app, first we will see what it is.

Also, Read: How to create multiple tabs form in Power Apps

Power Apps Print function

The Power Apps print() function allows you to choose any screen and fit it to a page before delivering it to a printer for printing or saving it as a PDF file to the local system.

By using the Print() function, we can open the current screen of the app in the default browser print dialogue where the app is playing.

The syntax or formula for the Power App Print function is:

Print()

We can use this formula on the OnSelect property of a Power Apps control such as button, icon, image, etc.

Note: When we use this formula on a Power Apps button’s OnSelect property that is displayed on Screen 1, only the content of Screen 1 is printed when we click it.

Power Apps Print function limitation

The Print function in Power Apps is primarily designed to print the contents of a screen or a form. While it is a useful feature, it does have some limitations that should be aware of:

  • The Print function is currently inaccessible on mobile devices and SharePoint forms.
  • Custom pages and embedded scenarios do not currently support the Print function.
  • The function doesn’t customize the layout or design of the printed page.
  • The Print function in Power Apps only supports printing in A4 size or letter size. If you need to print in a different size, you will need to use a third-party tool or create a custom solution.
  • The default browser printers will be available for printing.
  • Multiple pages cannot be printed using the Power Apps Print function.

Check out: Power Automate Dataverse Upload a File or an Image

Power Apps Print Screen Template

Power Apps provides two screen templates that help to size your print to letter size. These are Portrait Print and Landscape Print. We can find these templates by following the below steps:

  • Create or open a Power Apps canvas app.
  • Navigate to the +New Screen > Templates.
Power Apps print screen template
Power Apps print screen template
  • Choose a template to add to the screen based on the business requirements.
  • Suppose, we choose the Landscape print template and it will appear with a screen that has a print button option.
  • We can see the button has the print function on the OnSelect property to print the current screen page.
Landscape print screen template in Power Apps
Landscape print screen template in Power Apps

When you preview the app and click on the print option, the printing dialogue page will open in the default browser with some custom options such as Destination, Pages, Layout, Color, etc as shown below screenshot.

Working with Power Apps Print function
Working with Power Apps Print function

Also, we will see another expression on the print button’s Visible property.

Visible = Not(Parent.Printing)
Print function in Power Apps
Print function in Power Apps

As per the above expression, the button will not visible while the page will print. Keep continuing with this tutorial to explore more about Power Apps print function.

See also  Power bi gauge chart - How to use with examples

This is how to work with a print function in a Power Apps canvas app screen.

How to print a screen in Power Apps

In this section, we will see how to print a Power Apps screen. That means we will prepare a screen using different types of Power Apps components and then we will print that screen.

For this, the following steps are:

  • On the Power Apps, add a landscape print template screen where the Print button has a predefined expression as below:
OnSelect = Print()
  • Next, add some Power Apps controls to the screen such as text labels, text inputs, date inputs, dropdown controls, etc.
  • Here we have prepared an employee registration form using different types of components as shown below:
Power Apps print screen
Power Apps print screen

That’s it! Preview the app. Insert the data on all of the input fields and click on the print button. We can see a printing dialogue page will appear where you can print the page or print the screen in pdf format to the local system.

How to Print a screen within Power Apps
How to Print a Screen within Power Apps

This is how to print a Power Apps screen.

Have a look: How to Get Value from Text input in Power Apps

Power Apps Print screen to PDF

In this section, we will see how to print a Power Apps screen in PDF format and store that file in the local system.

For this, we are going to use the above Power Apps screen and the following steps are:

  • Click on the Print button, it will display a printing screen on the browser.
  • On the printing dialogue page, click on Destination > select Microsoft Print to PDF or Save as PDF.
  • Press Print.
Power Apps print screen as PDF
Power Apps print screen as PDF
  • Give a name to the PDF file and save it to the local system. Now we can find the Power Apps screen is saved in a PDF format.
How to Print a screen within Power Apps as PDF
How to Print a Screen within Power Apps as PDF

This is how to print a Power Apps screen in PDF format.

Power Apps Print screen by button click

Here, we will see how to print a Power Apps screen with a button click. That means we will insert a button control to the Power Apps screen. When the user clicks on the button it will ask to print the screen.

To work with this scenario, the following steps are:

  • Let’s take the above Power Apps screen or you can create a blank screen and add some Power Apps controls to it. We are going to use the above Power Apps screen where we will remove the print button.
  • Add a Power Apps button control to the screen and give a text as ‘Print’.
Power Apps print screen via button control
Power Apps print screen via button control
  • Insert the below expression on the button’s OnSelect property to print the screen with a single click.
OnSelect = Print()
  • Also, insert the below expression on the button’s Visible property. As a result, the button will invisible while printing.
Visible = Not(Parent.Printing)
How to Print a Power Apps screen via a button
How to Print a Power Apps screen via a button

That’s it! Save and publish the app for now. We can see that it allows you to print the Power Apps screen while clicking on the Print button.

See also  How to Remove line breaks from text in Power Automate?

This is how to print a Power Apps screen via a button control.

Read: How to Get Gallery Item By ID in Power Apps

Power Apps Print form

In this section, we will see how to print a form within the Power Apps. That means once the user submits a form, it will display all the details of the submitted data in another form and ask the user to print that Power Apps details form.

To work with this scenario, the following steps are:

  • We have prepared a Power Apps edit form ‘Employee Registration Form‘ using a certain SharePoint list named ‘Employee Details‘.
Power Apps print Form
Power Apps Print Form
  • On the above Power Apps screen, we have used a button control to submit the inserted data to the SharePoint data source list. Also, it will navigate to another screen where the user can view the submitted form details. For this, we have used the below expression on the button’s OnSelect property.
OnSelect = SubmitForm(Form1);
 Navigate('Employee registration details')

Where Form1 is the name of the Power Apps edit form and Employee registration details is the name of the other screen where the details of inserted data will visible.

PowerApps print form
PowerApps print form
  • Add a display form to the second screen.
  • Connect the Power Apps display form to the SharePoint list.
  • Insert the below expression on the display form’s Items property.
Items = Form1.LastSubmit
How to print a Power Apps form
How to print a Power Apps form
  • To print this page, add a print icon to the above screen and place it on the top-right corner of the header.
  • Insert the below expressions on the print icon’s OnSelect and Visible properties respectively.
OnSelect = Print()
Visible =  Not(Parent.Printing)
Power Apps Print a form after submitting
Power Apps Print a form after submitting

That’s it. Let’s preview the app and insert the details on the registration form and click on Submit button.

We can see it will save the data and navigate to the details screen with displaying the inserted data. Here, if you click on the print icon, the printing dialogue page will open on the browser.

How to print a Power Apps form after submit
How to print a Power Apps form after submitting

This is how to print a Power Apps form after submitting it.

Check out: Power Apps Set ThisItem Value [With Real Examples]

Power Apps Print Gallery

Similarly, in this section, we will see how to print a gallery within the Power Apps. That means when the user clicks on the print button, the Power Apps gallery will be printed.

At certain times, if our PowerApps screen contains a scrollable gallery, and we try to print it, we will notice that it saves a pdf or prints only a visible portion of the gallery on the Power Apps screen. Until now, the print() function in PowerApps only takes a screenshot of the screen and prints it, including the visible controls.

See also  Power bi gauge chart - How to use with examples

Below is a screenshot of a printing screen from a Power Apps gallery where we prepared a gallery with some product details (extracted from a certain SharePoint list). When we click the Print icon, only the visible portion of the gallery is printed.

Power Apps print a gallery
Power Apps print a gallery

But as per the requirement, the clients want to print the above scrollable gallery on one page. Unfortunately, there is no function to print a scrollable gallery within the Power Apps.

After some research, we determined that instead of a scrollable gallery, we could print the gallery filled with the items as shown below:

Power Apps print scrollable gallery
Power Apps print scrollable gallery

To print a gallery, as shown above, the following steps are:

  • On the above Power Apps screen, insert the below expression on the screen’s Height property.
Height = IIf(
    'Product Details Screen'.Printing,
    'Product Details Gallery'.TemplateHeight * CountRows('Product Details Gallery'.AllItems),
    794
)

Where Product Details Screen and Product Details Gallery are the names of the Power Apps screen and gallery respectively.

How to print a Power Apps gallery
How to print a Power Apps gallery
  • Similarly, add the below expression on the vertical gallery’s Height property.
Height = If(
    Parent.Printing,
    'Product Details Gallery'.TemplateHeight * CountRows('Product Details Gallery'.AllItems),
    614
)
Print a gallery in Power Apps
Print a gallery in Power Apps

That’s it! Save and publish the app for now. Preview the app and click on the Print icon. We can see that it will print the galley that is filled with items as shown below:

Power Apps print gallery
Power Apps print gallery

This is how to print a gallery within the Power Apps.

Power Apps Print background effect

In this section, we will discuss how to add or remove the background effect while printing a Power Apps screen.

Below, we have prepared a Power Apps screen with background effects such as a print icon, and text label with color including a pdf reader.

Power Apps print screen background effect
Power Apps print screen background effect

Recently, we were trying to print the above Power Apps screen using the Print() function. But when it opened the print dialogue we notice that the image won’t be a part of the print page. And the reason is that we have the option for background graphics turned off.

PowerApps print screen background effect
PowerApps print screen background effect

In order to reflect all the background effects while printing the Power Apps screen, the following steps are:

  • On the printing dialogue page, expand the More settings.
  • Turn on the option for Background Graphics.
Power Apps print screen with background graphics
Power Apps print screen with background graphics

Now, we can print the screen with the background effect within the Power Apps.

This is how to print a Power Apps screen with background graphics.

Additionally, you may like some more Power Apps tutorials:

Conclusion

From this Power Apps Tutorial, we learned all about Power Apps print() function. Also, we have covered below topics:

  • Power Apps Print function
  • Power Apps Print function limitation
  • Power Apps Print Screen Template
  • Power Apps Print screen
  • Power Apps Print screen to PDF
  • Power Apps Print screen by button click
  • Power Apps Print form
  • Power Apps Print Gallery
  • Power Apps Print background effect
>