The expression works correctly when I use it in an expression binding on a Perspective custom property. The dataset is returned.
When I try it in the report parameters as shown above I get, WARN: Error parsing default value expression for parameter "reportColors" -- Error executing script for runScript() expression:Report_Functions.reportColors
I can't find any documentation to say that runScript() won't work here.
I don't see any reason why this shouldn't work, from a glance at the code. Should be using a project specific script manager, as you'd expect. Indeed sounds like a bug
I opened a support ticket and was then offline for a few hours. I came back to it, created a new minimalist project, go that working. I compared with the original project and it seemed the same. I must have changed something as it's working now. I've closed the ticket.
For anyone interested in having master styles for all their reports:
In Project Library I created Report_Functions with this code:
def reportColors():
# Generate a list of standard colors for the reports.
# Generating a dataset allows all the colors to be passed through in one parameter.
headers = ['name', 'color']
data = []
data.append(["colorHeadingBg", "#002288"])
data.append(["colorHeadingText", "#FFFFFF"])
data.append(["colorTableHeadBg", "#777777"])
return system.dataset.toDataSet(headers, data)