I have a client who wants to send a page rendering of an Ignition page via email without user interaction. The idea is an event on the gateway would trigger the event. Since it is NOT an interactive session in a browser I don't think something like requestPrint would work (but I may be wrong). Since it is not interactive I can't think of a way to generate a screen shot. I tried looking at the HTML code that is returned but it is not old school HTML. It is jscript to load an interactive client so an httpPost would not work.
I could build pure HTML in a script but that would be a very hard to maintain (not a fan). I could have an interactive session running on a VM somewhere that could send keystrokes to the browser to accomplish what I want but that is a very flimsy solution at best.
Any ideas? Thanks
Your best option is to just make an Ignition report that duplicates the same data as whatever you're viewing in your Perspective session, and provide this to the customer.
Your next best option is to tell the customer this is impossible, unless they accept a report.
Your distant third best option is to set up a third party browser automation library like Selenium and manually script the whole process of logging in, navigating to the appropriate page, setting up anything necessary, and then rendering a screenshot out. This is basically your last idea, but with current "best" practices - you'll also get some help from the Automated Testing we already publish.
Your fourth best option would be to create a custom module that somehow uses Javascript API or some third party library to 'natively' capture a screenshot within the browser and return that to a scripting hook you control on the backend.
I like how you call bad options "next best"!! I did not know about Selenium and I will take a look at that but I was afraid the replies would be basically what you replied before I event pressed post. Thanks.
3 Likes
Your problem is interesting, did you find solution with Selenium? Curious to know whats your code?