Tablix and Charts

  • Hi,

    I've been using Visual Studio for a while now, but quite new to the reporting side of things and I've got an issue I can't quite solve.

    I've got a table and graph side by side. The table has a list of metrics for example :

    Headcount

    Starters

    Leavers

    Retention

    Turnover

    I've got 5 columns for each of these metrics (target, Q1, Q2, Q3 and Q4).

    What I want the user to be able to do is, select Headcount (which will then become highlighted) and the graph will display the results for Headcount only. I have done this, however, when the user selects Headcount the table will remove all of the other metrics from being visible as it's looking at a parameter to filter my results.

    So what I want is for all metrics on the table to remain visible to the user, regardless of the metric they have selected, but by clicking on each different metric the user can see the graph change to show the results associated with the metric they have clicked on.

    I hope this makes sense!

    Is this possible and whats the best way to implement this?

    Cheers,

    Danny.

  • Sounds like you're most of the way there. What you could to do is to use the parameter in a Filter on the chart object rather then against the dataset (this is what I assume you are doing?).

    You can apply filters at the tablix, chart, group scopes and they will filter independently of other objects even if they are sharing the same dataset.

  • Hey,

    Yeah, that's exactly what I'm doing.

    I was just about to look into filters actually, so I'll give this a go and let you know how I get on.

    Cheers.

  • Hi,

    I've set up the Filter to use the Parameter instead but I'm now trying to remove the Parameter from affecting my Tablix. Maybe my head is getting fuzzy now, or maybe I'm being really thick... but what is the best way to remove the parameter from my Tablix and make it apply to my chart only?

    Do I need to create two Datasets or can my dataset below be used for my Tablix and my Chart, with the Parameter only affecting my Chart?

    SELECT [Type]

    ,[Target]

    ,[Q1]

    ,[Q2]

    ,[Q3]

    ,[Q4]

    ,[Year]

    FROM table

    where [type] IN (@type)

    Cheers,

    Danny.

  • It depends on what you want really, but you shouldn't need two datasets.

    I think you need to remove the parameter from the query in the dataset, because that is filtering the results at the dataset level (i.e. before the table and chart get the data).

    You should then edit the chart properties and use the parameter in the Filters there.

    Parameters can be used anywhere in a report, they don't have to be in or attached to a dataset.

  • Hey,

    Hmm, I did try removing it from my dataset query but then it stops working for everything, even though my filter refers to the parameter. I know I am missing something really obvious! =)

  • I have created a couple of text boxes and linked these to the Parameter. So when I click between the Headcount and Starters text boxes, the Parameter does change, the but graph isn't picking this up.

    Perhaps I am missing something when setting up my filter:

    Expression =Parameters!MyParameter.Value(0)

    Operator In

    Value Headcount, Starters

  • No, you need to filter the dataset by the parameter in Filters. It would look like:

    Expression = Fields!Type.Value (or just select the [Type] field in the dropdown)

    Operator = In

    Value =Parameters!Type.Value (remember to remove the (0) if it's a multiselect since In wants an array, though I am not sure why you would use a multiselect for this scenario, and if you take multiselect off the parameter change the operator to '=')

  • Ahh, that's done the job! Works a treat now.

    Thanks for the help sir.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply