system.report.executeReport

Hi, I’m trying to use this function “system.report.executeReport” when I press a button with this code, nothing happen, this is from the manual, where is the error?


overrides = {"Number":"1", "Operator":"Moises","Description":"Description"}
bytesArray = system.report.executeReport(path="Report", parameters=overrides, fileType="pdf")

When you say nothing happens, what do you mean by that? Is bytesArray empty/null? There are no errors in the Gateway console? Have you tried wrapping this in a try-except and seeing if an error is thrown? Have you tried turning the Reporting.Scripting logger in the Gateway to trace?

How do you know it didn’t work? If that’s all of your code, you are throwing away the result. How many bytes did you get back in bytesArray?

Sorry I mean I don’t know what to do next, I don’t know how to get the file into my hard drive C:. How can I transform that byte array to a File?

system.file.writeFile is what you need next. It will take as an argument your byte array. Be sure to save the file with a .pdf extension so your computer knows what to do with it when a user double clicks on the saved file.

1 Like

Thanks you Kathy! it works

Hi Bro, MoisesZV. Can you show me the works that you have done for system.report.executeReport

Hi, may I know what actually I need to write for path and parameters.

The image above dint explain clearly what actually need to write the path and project. Anyone can explain ? Thanks in advence.

There’s an example at the bottom of that page.