I have googled this to death but the responses are not enough to google the answer.
I have a report made up, and a script that runs it on a push button to email out the report as a PDF. Google says that Tag events run globally, and that some how I am supposed to use A client tag to trigger the report(I also need a client open and running and can not trigger reports off of a plc tag in the current version of ignition). I have the same problem with a client tag that I do with the push button. How do I make the client tag trigger based off of a PLC bit/tag?
Every google answer says “use” “X or Y” but i google X or Y and can not figure out how to configure it.
After Reading and watching video 5
I am trying to use a Client Tag Event Script to trigger my script but I have an error with syntax.
#Get Report Data fileName = "AVC_OEE_Report.pdf" fileData = event.source.parent.getComponent('Report Viewer').getBytesPDF() # Send Email Details smtp = "SMTP.johndoe.com" sender = "SPD.AVCLine@johndoe.com" subject = "AVC OEE REPORT" body = "Attached is the PDF Report" #edited email since it is a public forumn recipients = ["JohnDoe@test.com"] system.net.sendEmail(smtp, sender, subject, body, 0, recipients, [fileName], [fileData])
I get a Sytax error on line 3 for
File “TagChangeScript:AVC/TestEmailScriptOnTagHigh”, line 3, in
AttributeError: ‘com.inductiveautomation.ignition.client.sqltags.im’ object has no attribute ‘parent’
Is there not a syntax to pull the pdf straight from the report? I have a report called AVC_OEE in the Reports section of my project browser.