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
https://inductiveuniversity.com/video/tag-scripts?r=/course/scripting
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
event.source.parent.getComponent(âReport Viewerâ).getBytesPDF()
error says
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.