Monday, March 19, 2012

Dynamically set chart type?

How can I dynamically set the chart type based on a report parameter?
-mdbTo my knowledge, chart type is not available at run time, only design
time.
Andy Potter|||Howdy,
Being a complete newbie to reporting services I can think of 2 Q & D
ways to do this.
1. Add all your charts of various type to the report and set visibility
hidden=true on all but the one chart indicated by the parameter, or
2. Add and configure a chart with designer, then copy the XML in the
code view. Repeat for all chart types. Then paste all chart snippets
into the rdl with a case/switch statement for the parameter.
1. is probably quicker and dirtier, 2. is perhaps a little less
inelegant.
HTH,
Sean G.|||FYI,
YMMV, but I couldn't do much with suggestion 2 neither with the chart
<Type> nor the entire <Chart> element.
But no trouble at all with suggestion 1. Add all desired charts in
designer and set visibility based on your parameter.
Sean G.|||SeanGerman@.gmail.com wrote in news:1136925323.993091.53580
@.f14g2000cwb.googlegroups.com:
> But no trouble at all with suggestion 1. Add all desired charts in
> designer and set visibility based on your parameter.
Problem with that is that the data probably gets queried once for each
chart, no? In other words, the charts are being generated, you just can't
see them.
Its ok I found another way to do what I needed to do. Thanks!
-mdb

No comments:

Post a Comment