This is a migrated thread and some comments may be shown as answers.

Hide Series at runtime

2 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brent Hetland
Top achievements
Rank 1
Brent Hetland asked on 24 Jun 2015, 06:52 PM

Hi

I am using Q2 2014 SP1 of Telerik Reporting.  My report currently contains a single Graph in the detail section.  It has a barSeries and two lineSeries.

However, there are times when I only want to show one of the two line series.

I'm binding the graph to a strongly typed list of objects and the object has a property on it that will let me determine if I want to hide the line series.

 

My specific example is this:

I am already binding my report's DataSource property to ReportItem.DataObject.BowlerValues  (this is my strongly typed list).

My graph might need to show Planned (bar), Forecast (line) and Actual (line) values.

A BowlerValue object has a property on it called "ShowForecast".

If ShowForecast is false, I will want to hide the Forecast Line Series.

 

How can I do this?  Can I use Bindings in any way?

Thanks,
Brent

2 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 29 Jun 2015, 07:37 AM
Hello Brent,

You can hide Graph series using one of the following approaches:

  • Use the Series.ConditionalFormatting property to set a conditional formatting rule for the current series which sets its visibility;

  • Use the SeriesGroup.Filters property to apply a filter to some of the series;

  • Create the Graph definition programmatically based on the value of the ShowForecast property;

  • Create two separate Graph items using the report designer and change their visibility based on the ShowForecast property;


Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brent Hetland
Top achievements
Rank 1
answered on 29 Jun 2015, 06:02 PM

Hi Nasko,

Thanks.  While you did list some options and presented some links, you gave no real technical detail...

After I submitted the forum post, I went down the road of creating a duplicate graph which is your 4th bullet.  But you give absolutely no indication of how to do it.  I'm fairly new to Telerik Reporting, but I knew I could create a Binding that referenced my ShowForecast Field, and have it control the Visible property of the Graph.

Thanks again for the reply.  I'd encourage you next time, to give more detail.

Brent

Tags
General Discussions
Asked by
Brent Hetland
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Brent Hetland
Top achievements
Rank 1
Share this question
or