Chart I had a great opportunity to blog about one of the technologies I am very much in love with and continue to embrace. It has been a little time since my previous post in which I introduced the API.

Since then, Telerik Reporting has introduced very exciting new features, HTML5 Report viewer, responsive design and Report Designer just to name a few. Telerik Reporting is yet providing us with plenty to talk about.

The Telerik company has rebrand itself and with that It has change the reporting API - although not quite significantly. Specific to Telerik Reporting, it is needless to say that the support that Telerik Reporting has out of the box, to aid create engaging reports, is very powerful.

The Introduction of report designer a few releases ago, extended the beauty and functionality of the WYSWG approach. Thus, powerful reports could be created without the comprehensive knowledge of the report code or either writing a single line of code.

There might be a few instances however, in which understanding the code may become very useful. In my experience I have been presented with this reality a few times when dealing with Chart or Graph report items.

The New Way

The principles of API has remained the same but while little has change, I though it will be a good idea to introduce a project that will illustrate the code principles; updated of course with the most recent licenses of the API. I hope this project could serve you as a great start kit if you are looking to understand Report elements such as tables or Charts.

   1: // before
   2: Telerik.Reporting.TableGroup tg  = new Telerik.Reporting.TableGroup();
   3: tg.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] { new Telerik.Reporting.Data.Grouping() });
   4: //now
   5: Telerik.Reporting.TableGroup tg = new Telerik.Reporting.TableGroup();
   6: tg.Groupings.Add(new Telerik.Reporting.Grouping());

Explaining the Source Code

The source code contains two static classes – Table Creator and ChartCreator – they both generate a Table object and chart objects that is then injected into the Report. The code provide a great compilation of how to’s. Among them, chart that display historical stock prices obtained via a Yahoo finance web service.