I'm doing a project for a customer which involves many multi-page reports. I'm applying simple styling to them. I've used data key bindings to bind the colors to values set in the report parameters.
The customer may wish to modify the theme so I'd like to set the styles in session.custom variables so I can do a global modification as one would with CSS in Perspective.
Fonts are easy: e.g., 'Dialog, Plain, 9'. The string gets passed in and works.
How do I pass in a color? If I create an expression binding on the session.custom variable it returns something like, java.awt.color[r=0,g=85,b=142]
but the report then goes back to default grey values.
Any idea on how to pass in a value that the report will understand?
I haven't tried, and don't have an environment with Reporting handy to test on, but will it accept the colors in HTML format? If I remember correctly, it prefers #FF00FF type formats if you want specific colors (even if they reference Java.awt.Color directly in the ReportMill manual)
I had found Kathy's posts in that thread but it didn't seem right at the time. Her proposal does work but at the cost of two parameters per style definition:
One (the passed in external parameter) to take in a color string such as "0, 200, 0" or '#00aa00' or 'aqua'.
Another (internal) to reference that and convert it. e.g., toColor({colorString1})
It works but requires two parameters per color which is a bit messy. I'll play around some more tomorrow.
Good idea, Phil, and much neater at the expense of only one additional parameter.
I created the dataset with name (string) and color (color) columns. That gave me the color picker, etc., and created the colors. When I came back to it the dataset edit dialog shows that the color column has been converted to 'Column Type: Object'.
For now I've recreated the table with name (string) and color (string) and entered the colors in form 0, 200, 255, etc. Then in the report I can create the individual styles by setting their default values to toColor({reportColors}[0, 1]), etc.