Using SAS 9.3 and trying to adhere to DRY by defining a custom style and using it with multiple ENTRY statements throughout a PROC TEMPLATE's statgraph block.
Custom style:
proc template;
define style llama;
parent=styles.fancyPrinter;
style CustomFonts from GraphFonts /
'GraphValueFont'=("<sans-serif>, <MTsans-serif>",25pt,italic)
;
class foo from GraphValueText /
font = CustomFonts('GraphValueFont')
color = GraphColors('gtext');
end;
run;
and then opened by a style= option in an ODS statement. I try to use foo:
Entry halign=left "bar / 1000" / textattrs=foo;
but get the log message:
NOTE: The style element 'foo' in the option TEXTATTRS is invalid. The default will be used.
It works fine when the TEXTATTRS is set using a definition like this (but since I'm using it a bunch of times, it won't be DRY):
textattrs=GraphValueText(weight=bold size=16pt color=CX800080)
Also, I know ODS is reading the style definition, because if I do:
style GraphFonts from GraphFonts
and change the fonts, it'll impact the graphs.
I don't have a good answer unfortunately for how to do this, though it's possible one exists.
What I do think is that GTL isn't completely listening to you. For example:
Notice you don't get any errors about GraphUnicodeText... but you also don't get any effect from it. My guess is that GTL is doing its work with only partial awareness of the style, and thus isn't able to always respect what you ask it to do.
My suggestion (at least until/unless Sanjay or Dan or similar can help you find a better one) is to use a macro variable and/or a dynamic variable for this purpose.
You can then reuse
entrycolor
in multiple places in the template, and allow it to be specified by the user at runtime. It's not ideal, but it does work, at least...