Excecute a Report changing parameters using a button


Is it possible to execute a Report changing a parameter value using system.report.executeAndDistribute() in a button?
I have some Reports with the same design but I need to change a parameter value, for example, I have Alarm Reports from different PLC, the report structure is the same for each PLC.

Yes, you can set parameter values. See the documentation, there’s an example near the bottom here: https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute


Thank you! I have a new problem:see_no_evil:, this is my code

settings={“path”:“C:\Reportes\PLC-500”, “fileName”:“Reporte Disparos Bomba B.pdf”, “format”:“pdf”}
system.report.executeAndDistribute(path=“Reporte Disparos”, project=“UCC”, parameters=Param, action=“save”, actionSettings=settings)

but my report it’s not ok and I don’t know why

What am I doing wrong?

This is probably supposed to be a tag read; try:

Param={"Disparos": system.tag.read("Datasets_Backups/Disparos/PLC500_Disparos_BombaB/DataSet").value}
1 Like

Thank you soooooooooo much!!! :pray: It works perfectly now

1 Like