Printing From the Scada
-
Hi,
Does anyone know if it's possible to print either the current page of a scada either with a button on screen or based on tag change?
Kind Regards
Billy -
Hi Billy,
I'm not sure what you mean, 'print'. Mango has reporting built in that creates files of data. There is not currently an event handler to trigger a report, but you can trigger reports from a scripting environment so it is possible. You can then print these files if you want to get data out. The pages themselves are only known to Mango as code, it takes a browser to render the code for a page to become a page.
I think every browser supports printing the page you have open if you press control P, but there is no access to a browser from the Mango environment. In a dashboard you may be able to call print() and figure out how to programmatically get your browser to print its current display. It's probably possible, but I'm not sure.
I believe every major desktop operating system will have some kind of printscreen.
If you can explain more what you mean by "print the current page of scada" I may be able to advise better.
-
@phildunlap
Hi,
The system is to log who is in the building on a graphical screen which in the event of a fire needs to be sent to a already configured printer at the press of a button so an easy rollcall can be done,
Hope that's cleared things up
Regards
Billy -
You can create a component which will call
window.print()
- https://developer.mozilla.org/en-US/docs/Web/API/Window/printHowever it will still popup the print dialog before printing.
-
I can't say I've ever delved into that problem, but it's not impossible for printers to have a protocol you could interact with using TCP/IP and scripting data sources. Maybe your printer supports PJL? Or perhaps LPD? (I just learned what those were)
-
@jared-wiltshire
Hi,
I'm a bit new to this with the custom components how would i go about writing the code for it? the tutorial you linked is a little unclear on how th code would actually work? i'm just after making a button you would press to call up the printer dialog?
Regards
Billy -
Actually, you can make it a lot easier than that. You could just set the
onclick
attribute of your button for this use case.e.g.
<ma-button raised="true" label="Print" onclick="window.print()"></ma-button>
You can add some custom CSS to hide the top bar when printing -
@media print { .ma-ui-main-toolbar { display: none !important; } }