Print A Form In Power Apps

Print A Form In Power Apps

The ability to print in Power Apps canvas apps appeared in my tenant this week. Printing has been one of the most requested features for a long time. Though no official announcement was made I have been able to figure out how to use the new printing capabilities and I would like to share that knowledge with you. In this article I will show you how to print a form in Power Apps.

Table of Contents:
Introduction: The Work Order App
Create A Printable Screen & The Print Function
Setting The Paper Size
Print The Power Apps Form
Using The Printing Property
Final Thoughts




Introduction: The Work Order App

The Work Order App is used by the employees of a plumbing services company to view details about the jobs they are assigned to. Employees want the ability to print out paper copies of the work order.

Create a new SharePoint list called Work Orders with the following data:

WorkOrderAppointmentStartCustomerNameLocationIssueReportedMaterialsRequired
100203/28/2021 9:00PMJessica Jones67 River Road, Winnipeg, Manitoba, R0G 0B0Water is drippping…5 – PVC Pipes
1 – Tube Of Selant
10 – Screws



Open Power Apps Studio and create a new app from blank. Rename Screen1 as Work Order Screen. Insert an Edit Form called frm_WorkOrder onto the screen with Work Orders as the datasource. Then change the Item property to this code.

First('Work Orders')



The Work Order form will now show the first record in the SharePoint list. In a full version of this app the form would be required to display any record in the list. But since this is an only example for the purposes of explaining printing we will leave it that.




Create A Printable Screen & The Print Function

Employees of the plumbing company want to print out a paper copy of the form. The printed form must be easily readable in black & white so we will make a new screen with a printable copy of the form.

Insert a new Portrait Print Screen and rename it Print Screen.



The new screen will appear blank with a Print button in the top-right corner.



If you look at the OnSelect property of the Print button it will show the Print function. This function makes the print page dialog appear when the button is clicked.

Print()



Go back to the Work Order Screen and add a Print icon to the navigation bar.



When an employee clicks the Print icon it will take them the Print Screen. Use this code in the OnSelect property of the Print icon.

Navigate('Print Screen')


Setting The Paper Size


The printed form must fit on a letter size paper sheet (8.5″x11″) and be visible in black and white. Start by changing the Fill of the Print Screen to White…



…then make the screen Height = 1056 and the screen Width = 816. These dimensions will ensure the screen has the same aspect ratio as letter-sized paper. Printers display 96 dots-per-inch so we must scale down from 1100 x 850.

Now copy + paste the form frm_WorkOrder from the Work Order Screen onto the Print Screen. Place it in the center of the page and add an additional label with the words “Work Order” at the top.



Put the app into Preview Mode by clicking the Play icon in Power Apps Studio. Then click the Print button. A print dialog will appear on the screen showing the Work Order form. Ensure the paper size is Letter, the layout is Portrait and the scale is Default.



Alternatively, we can remove the borders from the form’s input fields by changing the DefaultMode to FormMode.View.



This version of the printed form looks much cleaner (although the appointment start time could use some work).




Using The Printing Property

When the page is printing the “Print” button will disappears. This behavior is driven by a screen property called Printing.



To hide a control when a screen is being printed use this code.

Not('Screen Name'.Printing)




Final Thoughts

The printing features I just shared are only phase one in a series of updates. Per Emma Cooper, Senior Program Manager at Microsoft:

"The second phase of this work will be to introduce a function that enables saving a screen as a PDF in the app. This will allow compatibility to leverage Power Automate flows to do many of the events such as saving it somewhere, sending an email and other common actions. This is currently still in progress, and we can provide an update in the next few weeks." - Emma Cooper




Printing in Power Apps has clearly taken a huge leap-forward but there is still much to be desired. In the future I would like to see:

  • Printable forms with multiple pages
  • Printable galleries and data tables with multiple pages




Did You Enjoy This Article?

Subscribe at the bottom of this page to have new articles sent directly to your inbox the moment I post them.


Questions?

If you have any questions or feedback about Print A Form In Power Apps please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

26 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Prashant
Prashant
2 years ago

Hello Matthew,

That`s a great article.

Is there any feature needs to be enable or any version needs to be updated to see this screen (Portrait Print). I am not able to view this feature.

Could you please help.

Thanks,
Prashant

Prashant
Prashant
2 years ago

Thanks for the info Matthew.

Necdet Saritas
Necdet Saritas
2 years ago

Great job. Thanks for the sharing Matthew

Emilio Roqueta
Emilio Roqueta
2 years ago

I think this paragraph is backwards: “..the screen Height = 850 and the screen Width = 1100″
But we get the point.

Thanks for sharing Matthew !!

Kishore
Kishore
2 years ago

Hello Matthew,
That`s a great article.

Debbie McLaughlin
Debbie McLaughlin
2 years ago

so I simply added a icon to an existing power app form and put in the select print(). It works great if I preview while I’m i designing. But once saved if I go back to the view and select a doc.. the print icon does NOTHING. What am I doing wrong? This looks so easy.

Shomal
2 years ago

Hi Mathew,

This is great.
Will also look forward to saving forms as PDF in the future.

Dean Moran
Dean Moran
2 years ago

Step in the right direction but my clients need the ability to print multiple pages. My clients invoices and returns have variable length text fields – sometimes a single page will suffice other times could run over several pages. I think this is an essential feature to be of any practical use.

Subro
Subro
2 years ago

Matthew! Great article! Can you share your thoughts on how to make the print work on SharePoint Custom List form, for some reason the print() function is not being called when it is on the page. For our requirements we have to go with SharePoint custom list form.
Thanks,
Subro

Subro
Subro
2 years ago

Thanks Matthew for the update.

Gil
Gil
1 year ago

Thanks for that article.
Does print should work also on mobile phones? From some reason it doesn’t work for me..

Gil
Gil
1 year ago

Thank you for the quick answer.
So no option to print from power apps app?

Kim
Kim
1 year ago

Exactly what I was looking for !! Thanks so much

Joe Barneski
Joe Barneski
5 months ago

This is all awesome but what if you have a whole database of Work orders and you wanted to print out the form for ALL the work orders for a certain date with a single button click?

George Winters
4 months ago
Reply to  Joe Barneski

use ForAll

Craig
Craig
5 months ago

What if frm_WorkOrder scrolls off the page. How can it print it as more than one page and not just what you see on the first page?

(edit) I see that you can just make the height of the page bigger, but it would be better if it was dynamic and looked prettier.

Last edited 5 months ago by Craig