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

Renaming Legend Items

1 Answer 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 18 Apr 2012, 06:21 AM
Hello,

I think i have this mostly figured out but im getting errors. Im getting trouble at this line: labelItem1.TextBlock.Text = procChart.Report.Parameters["Due Beyond"].Value.ToString;...My understanding of C# is limited so i dont see where im going wrong. Can you help me figure this out?

namespace Reports
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;


    /// <summary>
    /// Summary description for DeliveryStatus___Client.
    /// </summary>
    public partial class DeliveryStatus___Client : Telerik.Reporting.Report
    {
        public DeliveryStatus___Client()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();}


            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        private void chart1_ItemDataBinding(object sender, EventArgs e)
{
            var procChart = ((Telerik.Reporting.Processing.Chart)sender);


            Telerik.Reporting.Charting.LabelItem labelItem1 = new Telerik.Reporting.Charting.LabelItem();
            Telerik.Reporting.Charting.LabelItem labelItem2 = new Telerik.Reporting.Charting.LabelItem();
 
                labelItem1.Marker.Visible = true;
                labelItem1.Name = "LegendItem1";
                labelItem1.TextBlock.Text = procChart.Report.Parameters["Due Beyond"].Value.ToString;
                labelItem2.Marker.Visible = true;
                labelItem2.Name = "LegendItem2";
                labelItem2.TextBlock.Text = procChart.Report.Parameters["Due Monday"].Value.ToString;
                this.chart1.Legend.Items.AddRange(new Telerik.Reporting.Charting.LabelItem[] {
                labelItem1,
                labelItem2});
            this.chart1.Legend.Items.AddRange(new Telerik.Reporting.Charting.LabelItem[] {labelItem1,});
}




            






   
}
        }
}


    

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 19 Apr 2012, 02:16 PM
Hello,

The problem is that you're trying to invoke the ToString() method but you're missing the parenthesis. Additionally the last two lines of code appear to do the same thing, so you can remove the last line.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Terry
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or