I have to say, I really like what I see with Telerik Reporting. The accuracy of the export to Excel and PDF is what has led me to look at it deeper and deeper. However the Chart Object in the reports simply sucks. When I was using the RadChart in a standard ASP.NET page I could easily get in and change individual bar colors during the ItemDatabound event.
The attached image is a chart I created using RadChart and a standard ASP.NET webform. If the value in the PeakUsages series (Bar) exceeds the value in the LicenseCount series (line) then the color of the chart bar is changed to red. This is accomplished with the simple code listed below.
However the chart in reporting (which as I understand it is suppose to be RadChart under the covers) can't do this, It doesn't appear that you can modify the chart during the databound event. Why?
To make matters worse, attempting to refine the charts visual appearance in Visual Studio is painful at best. You have to drill into 15 different properties to change the back ground color of the plot area. Then when you use preview to see how it looks and then switch back to design mode. Your previous properties context is completely lost. When you return to design mode your selection is set back to the report not the previous selected object and you lose all of the expansion you had done in the properties pane. (Note I am using VS2010 RC with Q1 2010).
The shear fact that I can't duplicate the chart functionality in Telerik Reporing is forcing me to continue to use RadGrid and RadCharts as my reporting solution, which really sucks as I have to spend a lot more time focusing on code to properly export the Grid to Excel and PDF.
When is the Chart in Telerik reporting going to become a first class object?
Things I'd like to see include
- Full control over the chart rendering from the code behind. Allow me to have the same ItemDataBound event logic as RadChart
- Context, Context, Context. Remember where I was when I return from preview, don't force me to reselect the chart, expand properties etc.
- Cut and paste a chart definition, or access to the markup for the chart.
- I want to be able to paste a chart definition from an asp.net page into a report. Or allow me to mark it up in the same manor, which would allow me to quickly duplicate the look and feel and refine it without having to mess with the properties pane.
protected void rowChart_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e) |
{ |
if(e.SeriesItem.Parent.Name == "PeakUsages") |
{ |
DataRowView drv = (DataRowView)e.DataItem; |
if(drv["PeakUsages"] != DBNull.Value) |
{ |
if(Convert.ToInt16(drv["PeakUsages"]) > Convert.ToInt16(drv["LicenseCount"])) |
{ |
e.SeriesItem.ActiveRegion.Tooltip = string.Format("Usage exceeds license: \nDate: {0}\nUsage: {1} \nLicense: {2}", |
Convert.ToDateTime(drv["UsageDate"]).ToShortDateString(), |
drv["PeakUsages"].ToString(), |
drv["LicenseCount"].ToString()); |
e.SeriesItem.Label.Visible = false; |
e.SeriesItem.PointAppearance.FillStyle.MainColor = Color.DarkRed; |
e.SeriesItem.Appearance.FillStyle.MainColor = Color.DarkRed; |
e.SeriesItem.Appearance.FillStyle.SecondColor = Color.Red; |
e.SeriesItem.PointAppearance.FillStyle.SecondColor = Color.DarkRed; |
e.SeriesItem.PointAppearance.Border.Color = Color.DarkRed; |
} |
else |
{ |
e.SeriesItem.Label.Visible = false; |
e.SeriesItem.PointAppearance.Visible = false; |
e.SeriesItem.ActiveRegion.Tooltip = string.Format("Date: {0} \nUsages: {1}", Convert.ToDateTime(drv["UsageDate"]).ToShortDateString(), drv["PeakUsages"].ToString()); |
} |
} |
else |
{ |
e.SeriesItem.Visible = false; |
e.SeriesItem.Label.Visible = false; |
e.SeriesItem.PointAppearance.Visible = false; |
} |
} |
else |
e.SeriesItem.Label.Visible = false; |
} |