Telerik Forums
Reporting Forum
3 answers
193 views
Hi,

I'm trying to color the series items in the Pie chart, but I failed.
Here is my code:

//Pie chart Item Data Binding
        private void pieChart_ItemDataBinding_1(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart;
            Telerik.Reporting.Processing.DetailSection section = (Telerik.Reporting.Processing.DetailSection)chart.Parent;
            Telerik.Reporting.Processing.IDataObject dataObject = (Telerik.Reporting.Processing.IDataObject)section.DataObject;
            object rowdata = (object)section.DataObject.RawData;
            Telerik.Reporting.Processing.TextBox procTextbox = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("taskIDTextBox", true)[0];
  
            Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
            Telerik.Reporting.Charting.ChartSeries series = new Telerik.Reporting.Charting.ChartSeries();
            series.Type = ChartSeriesType.Pie;
            Telerik.Reporting.Charting.ChartLegend legend = new Telerik.Reporting.Charting.ChartLegend();
  
            string CoverDescription;
            int itemValue;
  
            string commandText = string.Empty;
            SqlConnection connection = new SqlConnection(global::QTaskReporting.Properties.Settings.Default.QTDbConnString);
            commandText = "SELECT COUNT(*) AS ItemCount, SDesc, SColor FROM vwSubTasksAndStatuses where TaskID = " + procTextbox.Value + " GROUP BY SDesc,SColor";
            SqlCommand cmd = new SqlCommand(commandText, connection);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
  
            foreach (DataRow rowView in ds.Tables[0].Rows)
            {
                Telerik.Reporting.Charting.ChartSeriesItem seriesItem = new Telerik.Reporting.Charting.ChartSeriesItem();
  
                //The chart Y value will be based on the Value amount 
                seriesItem.YValue = Convert.ToInt32(rowView["ItemCount"]);
                seriesItem.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
  
                //The chart item label should be set to the Value amount 
                itemValue = Convert.ToInt32(rowView["ItemCount"]);
                seriesItem.Label.TextBlock.Text = rowView["SColor"].ToString().Trim() + " - " + rowView["SDesc"].ToString();
                seriesItem.Label.Appearance.LabelLocation = Telerik.Reporting.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
                seriesItem.Label.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(58)))), ((int)(((byte)(112)))));
                seriesItem.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
                seriesItem.Appearance.FillStyle.MainColor = ColorTranslator.FromHtml("#" + rowView["SColor"].ToString().Trim());
  
                //Assign the chart item description
                CoverDescription = rowView["SDesc"].ToString();
                seriesItem.Name = CoverDescription.Trim();
  
                //Give the "New" chart item an exploded appearance
                if (seriesItem.Name == "New")
                {
                    seriesItem.Appearance.Exploded = true;
                }
  
                series.AddItem(seriesItem);
  
            }
  
            //Display the legend
            series.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;
            series.Appearance.Border.Color = System.Drawing.Color.White;
            series.Appearance.Border.Visible = false;
            series.Appearance.DiameterScale = .90;
  
            series.Appearance.ExplodePercent = 10;
  
            chartDef.Series.Clear();
            chartDef.Series.Add(series);
  
            chartDef.Legend.Appearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.TopRight;
        }

View attached screen-shots in order to show you that the Pie chart doesn't display the colors I sat for the items.
By the way the pie chart displays the real data, but the colors are wrong.

Please, I need your help in order to solve the above problem.
It is appreciated to send me the modified code.

Regards,
Bader
Steve
Telerik team
 answered on 15 Aug 2011
1 answer
114 views
Does the Telerik Reporting Support Security Methods Like Encryption and Password protection.

On all Exported Types
Steve
Telerik team
 answered on 15 Aug 2011
4 answers
643 views
Hi,

I have a strange question for you : it is possible to add parameters to the report viewer using JS ? In my case, I have a splitter with 3 panes (take a look to the attached png) and I want my report (in the right lower pane) to show the value of the textbox in the upper pane. Moreover, I don't want my left pane (the one with the tree view) and my upper pane to be refresh each time I reload the report. In other words, when I click on the button "preview", the report should be updated with the good values, but not the upper pane neither the left pane. So, I think I should use javaScript, but I'm not sure if it possible to realise my scenario with JS.

Does anyone have a solution for me ?
Thank you

David
Plamen
Telerik team
 answered on 15 Aug 2011
3 answers
122 views
I worked for 1 year with XtraReport of DevExpress, but I've only had problems, very unstable, unfriendly, simple things end up being very complicated. The designer has many many many bugs and work with this has been torture. I can write 50 or 60 lines of problems encountered with the XtraReport.

For 5 days I have been testing the Telerik.Reporting and I'm happy, we are seriously evaluating purchase, ease of use is incredible. I really like the ReportViewer is simple but very powerful, I have to write too much code to use.

Let me clarify, I develop applications for Windows Forms.

I have 2 basic questions:

1.- I can use my connection object instead of the connection string?
2.- How I can bind a datable to the report. I've tried in many ways without success

Dim oTabla As New DataTable
       oTabla.Columns.Add("F1")
       oTabla.Columns.Add("F2")
       oTabla.Columns.Add("F3")
       oTabla.Columns.Add("F4")
 
       Dim objectDataSource3 As New Telerik.Reporting.ObjectDataSource()
       Dim oReport3 As New ReportNew1
       oReport3.DataSource = oTabla
 
       Dim oFrm As New FrmReportViewer
       oFrm.ReportViewer1.Report = oReport3
       oFrm.ReportViewer1.RefreshReport()
       oFrm.ShowDialog()      

Thanks you.

Wonderful product.!!

David.


Peter
Telerik team
 answered on 15 Aug 2011
3 answers
202 views
I have a couple of parameterd on my report which have about 9500 string items in them.

I use a Telerik.Reporting.SqlDataSource to fill these up and i am displaying the report in the silvelright report viewer.

The problem is that when you drop down the combo box it take about 20-30 sec for it to happen and also once done it very sluggish scrolling up and down.

Does any one know how to fix this?

Thanks
Peter
Telerik team
 answered on 15 Aug 2011
1 answer
87 views
We are currently creating userdumps from our project while trying to debug a problem and seeing the following error when we generate PDFs.

Exception object: 0000000005a68790
Exception type: System.Resources.MissingManifestResourceException
Message: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Telerik.Reporting.XamlRendering.WpfReport.resources" was correctly embedded or linked into assembly "Telerik.Reporting" at compile time, or that all the satellite assemblies required are loadable and fully signed.


We're not using Xaml/WPF at all and all we have referenced is Telerik.Reporting.  Is there another assembly I should be adding so that this exception goes away?
Peter
Telerik team
 answered on 15 Aug 2011
14 answers
498 views
Hello

I have this report that has around 300 pages. Exporting it to CSV takes about 20 seconds and that's ok. But exporting it to PDF or simply displaying it takes around 2 minutes and this seems unacceptable for my client.

Is there any way to speed this up ?
Peter
Telerik team
 answered on 15 Aug 2011
3 answers
130 views
I have web app that customer wants an aspx page converted and saved to a folder, programmatically, without viewing converted pdf.  Is this possible with Telerik Reporting?  I know there are other third party controls out there that can do this, but I was hoping I could use Telerik control.


Thank you,
Bryan
Steve
Telerik team
 answered on 15 Aug 2011
6 answers
356 views
I was hoping to bind the presence or not of a grouping in my report to a dropdownlist/parameter of enabled/visibility??

Is this possible?
I have read the posts about looking at the Initializecomponent code, but am unsure of what to include from this??

perhaps if i wipe the grouping then have another look?

Is it possible to have this dropdown to select grouping within the report or would it be easier to implement external as an actionlink or some such??


Similarly I am unable to get multiple columns working in this report...I've read the documentation on ensuring there are no labels etc extending beyond column width

Anything else I should be looking at??
danparker276
Top achievements
Rank 2
 answered on 14 Aug 2011
1 answer
191 views
I show time values in Y Axis as second, but some times values can be big. For example 1000 second.
So this time not clear enough.
And than I want to show timespan values in Y axis with format like hh:mm:ss. How can I do this?   
I use Telerik Report Q2 2011

Thanks.
Peter
Telerik team
 answered on 12 Aug 2011
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?