Telerik Forums
Reporting Forum
3 answers
299 views

Plotting Pie chart issue:

Data Structure: QuestionID, QuestionName, Answer, ResponseCount

Requirement : Need to plot six pie charts per page (Horizontally 3 per line)

Problem Statement: We are getting the pie chart plotted in vertical and not in horizontal

Solution tried:

We need to plot a pie chart based on the Answer and responsecount. We tried this below option of plotting the chart in the groupheadersection of the report.
 
Chart Title: Question Name
Chart series Item Y Value : ResponseCount
Chart series Item Name : Answer

GroupHeaderSection ItemDataBinding :

In this, we are getting the datatable from the report datasource and binding it to the chart. The piecharts are rendered correctly but getting only 3 pie charts per page in vertical.

We are tried this option based on the below link:

http://www.telerik.com/community/forums/reporting/telerik-reporting/graph-for-each-group.aspx

Note:
We have attached the datastructure in the spreadsheet,generated pie charts (refer image).

Expected Output:
6 Pie charts per page (3 pie charts per line horizontally)

private void groupHeaderSection2_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.GroupSection groupHeaderSection = (Telerik.Reporting.Processing.GroupSection)sender;
            Telerik.Reporting.Processing.Report report = groupHeaderSection.Report;
            var group = groupHeaderSection.DataObject["QuestionID"];
            DataTable table = (DataTable)report.DataSource;
            DataRow[] rows = table.Select(string.Format(CultureInfo.InvariantCulture, "QuestionID={0}", group), "ResponseCount DESC");
  
            Telerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)groupHeaderSection.ChildElements.Find("Chart1", true)[0];
            Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
  
            chartDef.IntelligentLabelsEnabled = false;
  
            Telerik.Reporting.Charting.ChartSeries chartSeries = new Telerik.Reporting.Charting.ChartSeries();
            chartDef.Series.Clear();
            chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Pie;
            chartSeries.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
            chartDef.Legend.TextBlock.Visible = true;
            chartSeries.Appearance.ShowLabelConnectors = true;
            chartSeries.Appearance.StartAngle = 270;
  
            Telerik.Reporting.Charting.Styles.ChartMargins chartMargins2 = new Telerik.Reporting.Charting.Styles.ChartMargins();
  
            chartMargins2.Bottom = new Telerik.Reporting.Charting.Styles.Unit(20D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Top = new Telerik.Reporting.Charting.Styles.Unit(5D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Right = new Telerik.Reporting.Charting.Styles.Unit(5D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Left = new Telerik.Reporting.Charting.Styles.Unit(5D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
  
            chartDef.PlotArea.Appearance.Dimensions.Margins = chartMargins2;
  
            foreach (var row in rows)
            {
                chartDef.ChartTitle.TextBlock.Text = row["Description"].ToString();
                ChartSeriesItem item = new ChartSeriesItem();
                item.YValue = Convert.ToDouble(row["ResponseCount"]);
                item.Name = row["Value"].ToString();
                item.Appearance.Exploded = true;
                item.Appearance.FillStyle.FillType = FillType.Solid;
  
                item.Label.TextBlock.Text = row["Value"].ToString() + " - #%";
                chartSeries.Items.Add(item);
            }
            chartDef.Series.Clear();
            chartDef.Series.Add(chartSeries);
            
            chartDef.SeriesOrientation = ChartSeriesOrientation.Horizontal;
  
   
        }

Stef
Telerik team
 answered on 21 Jan 2013
3 answers
122 views
Hi There,

We are upgrading our Reports to Q32012 and work on table based layout feature of it.
We create the telerik reports dynamically and assign NeedDatasource event to load the data.

We have added new references to our project and have changed all possible assembly information correctly
Now in r & d phase things were working fine with older version but now it returns error.
I tried lot of stuffs after browsing few forums on the site but still i am not able to get rid of this error.

I'hv added following code in the constructor.
{
DataSource = null;
NeedDataSource += LoadData;
}


Can anybody have solution on it? Please help.

Stef
Telerik team
 answered on 21 Jan 2013
5 answers
597 views
I am having trouble finding any decent help or examples on how I can display Multi select parameters in a textbox in the report header.
My report has a multi select parameter filled with regions which I want to display as a comma separated list in a textbox.
I would think that this is a commonly required feature so you can display what the report is currently filtering on.
If I use the parameter value or text in the textbox it displays System.Text[]
Chris Gillies
Top achievements
Rank 1
 answered on 21 Jan 2013
3 answers
252 views
Hello All,


One of my report requirement comes to be showing the definition of every item name when mouse moves over the item--namely showing definition in the tool-tips

I am using the table container to hold the data. the medical terms show up in the first column. Right now, I hope i can show definition in tooltips for every term, which is maintained in my back-end table.

Who knows whether it is possible or not showing something in tooltips for the cell in table container?
 
Steve
Telerik team
 answered on 21 Jan 2013
3 answers
578 views
Hi All,
I am new to Telerik Reporting so excuse me if this is a newbie question.
I have searched the forums and it seems that the html textbox will render simple html.  However, when I try and use this control I get all the markup tags mixed with the text.  Is there some trick to getting it to work?
Thanks
Andy
Steve
Telerik team
 answered on 17 Jan 2013
1 answer
90 views

When I launch a crossTab generation and exit it once generated, my application does not fully release the memory, even if I call « GC.Collect () Â» or Dispose().

Elements/processes are still kept in memory, about 300MO.

When I look into the task manager and make  a comparison of the free available memory before launching the telerik component functionnality and after using it , I can detect that 300MO are not released.

So i suppose this is  linked to the telerik component.

 

As a result I have to exit my app before using the telerik component, otherwise I systematically get a crash.

A solution? 

 


Best regards
Steve
Telerik team
 answered on 17 Jan 2013
1 answer
144 views
I have create summary report by add a textbox in ReportFooterSection and set Value =Sum(Fields.Value)
when click export to csv I got an extra column show summary value in every rows
Elian
Telerik team
 answered on 17 Jan 2013
5 answers
244 views
Hi,

I am unable to set the font size of the x axis iem labels of a chart.

I have tried to set the it using PlotArea -> XAxis -> Appereance -> TextAppereance -> TextProperties -> Font -> Size
But that has no effect.

I have tried it on the supplied profuct line sales.trdx for Q3 2012 that comes with the Report designer, as well as custom reports i created in VS, to no avail.

Much Appreciated

Heinrich
Steve
Telerik team
 answered on 17 Jan 2013
1 answer
143 views
Is there a way I can change the filter in run time based on a report parameter?

Ex. The user can choose, via A, or via B
If A is selected, the filter should filter the data via column A in the database,
If B is selected, the filter should filter the data via column B in the database.

Thank you. 
Hadib Ahmabi
Top achievements
Rank 1
 answered on 17 Jan 2013
2 answers
314 views
I am trying to use one report for multiple items. I need to be able to sort the report in code behind on multiple fields.  

                    Dim sorting1 As New Telerik.Reporting.Data.Sorting()
                    sorting1.Expression = "=Fields.DriversLicenseExpiration.Date"
                    sorting1.Direction = Telerik.Reporting.Data.SortDirection.Asc

I found the above in the forums but I can not get it to work and I need to be able to sort on multiple columns  like:

sorting1.Expression = "=Fields.DriversLicenseExpiration.Date; Fields.ProgramGroup" 

Ryan
Top achievements
Rank 1
 answered on 16 Jan 2013
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?