Print after page loads

I have a page with a recordset and a print button, if I use the button it prints fine. I want to have it print automatically (show the print dialog) when the page opens without them having to press the button. I added javascript on page load and it show the print dialog as desired, but it prints without the variables from the recordset. So it’s printing before they load. I’m sure there is an easy fix if someone can point me in the right direction. Thanks

Hello,
If you are using a repeat children region you can use the static events to run your js function when the data is loaded.
So your code becomes:

<div is="dmx-repeat" id="repeat1" dmx-bind:repeat="serverconnect1.data.query1" onupdated="window.print();">
    <p>{{my_dynamic_data}}</p>
</div>

A print action has been added to the browser component. You can call it using the dynamic events.