cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kilaj1
Helper III
Helper III

Printing a long PowerApp

Hi

 

I have a Power App that can expand to over 4000 in height.  I'm using the Print() function to print this and while I see a lot of information on expanding a gallery using the Self.Printing  this option does not work for a canvas control.

kilaj1_0-1635451083981.png

 

If I hard code the height or set it to the datacards within the canvas height it works just find, but I cant leave it like this because when the app runs its taking that 4000+ height into account for the entire canvas and its unreadable/usable.

 

There is a Parent.Printing option, but it doesn't seem to work with my IF 

 

If(Parent.Printing=true,Approvals.Height+DataCard2_1.Height,680)

 

 

Is there another way to get the canvas to expand for printing?  I was thinking about using a variable to set the height when you click on print, but then what would reset it? may be a popup to say "return to form"?

2 REPLIES 2
AmeerJab
Resolver I
Resolver I

Hello Kilaj,

you got the good idea for it, you can as you said declare a variable first on the OnStart and set it to the default value which is ex(680) and then ofc the expand will be made by a trigger so you could also add a formula to change the value of the variable, where you could also add a button and set it's visibility to be if(height variable > 680, true, false)

 

hope this help,

regards.

kilaj1
Helper III
Helper III

Thanks for the reply

 

so I've got some of this sorted out, but I'm having a few weird issues.

 

When i select one of my records and they test the print, its cutting off the app, but when i do it the second time with no changes it works.

 

After the print screen comes up, because the Canvas control AND the Screen height are set to the datacard size (over 4000) when you close the print screen it goes back to the back VERY zoomed out.

 

What Ive done is have a line in a Gallery that Onselect 

 

set(Printscreen,False)

 

.

On the next screen Ive added to the Screen Height 

 

If(Printscreen=true,Approvals.Height+Review.Height+88,Max(App.Height, App.MinScreenHeight))

 

Approvals and Review are the data cards within the Canvas control

for the canvas control I've added to the Height

 

If(Printscreen=true,Approvals.Height+DataCard2_1.Height+100,680)

 

I have a print button on the next screen that has Onselect

 

set(Printscreen,true);

 

 

 i cant add the Print() here because the heights don't adjust in time for the print preview. The print preview comes us, sometimes with the issues I've mentioned above and with a huge white space to the right.  

 

I then have two other buttons that show up once PrintScreen is set to true, a button to Print 

 

Print()

 

and another to confirm printing complete 

 

Set(Printscreen,False)

 

 

The idea is that once you've printed, it would have taken you back to the APP to click on done to return to the normal size and view of the record.  Problem is its zoomed out once you close the preview and even if you click on the button to set the variable back to false, it says zoomed out.  I've opted to navigate back to the home page afterwards but this might not be ideal.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,863)