I am building an app to use as a drug & fluid calculator for paediatric patients in a hospital resuscitation setting. The home screen gets the age and weight of the patient and has a selection of calculators with different layouts linked from there.
Each individual calculator is homed in a vertical scrolling container in its own screen. The container displays "Fluid Grid" as the type when it's inserted.
I use the PDF function to print the calculators, handing it off to Power Automate to save a copy on a Sharepoint location before having it returned to the browser to download, open and print locally. All of this works perfectly using:
Set(varPrintmode, true); Set( varPDFtest, PDF('Emergency Calculator',{Orientation: PaperOrientation.Portrait, Size: PaperSize.A4, Margin: "20px", ExpandContainers: true}));
Set(varPrintmode, false);
Download(DownloadResusCalculatorPDF.Run($"ResusCalc_{Patient_Name.Text}_{Text(Now(),"ddmmyyhhmmss")}.pdf", {file : {name: $"ResusCalc_{Patient_Name.Text}_{Text(Now(),"ddmmyyhhmmss")}.pdf",contentBytes: varPDFtest}}).path);
In the Power Apps developed environment, when I click on the PDF button, it briefly zooms out the container so that all of the contents are visible on screen before returning to the base screen size. I can then open the PDF it's generated, scroll through the screen I'm already on or navigate to other calculators and print those in the same way. It all works really well.
The problem I'm encountering is in the published environment.
I enter the age and weight of the patient on the home screen and navigate to one of the calculators (Resus Calculator as an example).
I click the PDF button and it does what it's supposed to and returns a downloaded PDF to view and print. It doesn't briefly zoom out like in the developer environment but it does briefly hide the scroll bar on the side.
After creating my PDF, I can still scroll through this Resus Calculator screen as normal.
If I then navigate to a different calculator such as the Trauma Calculator and click the PDF button there, it will download a PDF of the entire container to view and print but it will then lock the scrolling on this second calculator. I can only see the first part of the container on the screen and it will remain locked until the app is closed and re-launched. This behaviour repeats for every other calculator screen I print from after the first calculator screen. The PDF will continue to print the entire contents of the container, not just what's on the screen.
Interestingly, the first calculator I print from will let me print over and over again and never locks the scrolling.
The formulas are essentially the same between all the calculators other than the containers they reference and the file names they create.
I can print from any calculator and not lock the scroll as long as it's the first one I do, the subsequent prints will lock.
If I update the patient details on the home screen, the contents displayed on the non-scrolling calculator screens update appropriately so it's only the scroll that has stopped working.
To reset the frozen scrolls, I need to close the entire app.
I've found one other reference to what I think is the same problem but that was a question without an answer, posted in an incorrect forum. Has anyone encountered this behaviour and devised a solution?
As a temporary workaround, is there a way to force a reset of an app without closing the window and reloading?
Many thanks.