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

Telerik Report with in Chart.

0 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
mani kandan
Top achievements
Rank 1
mani kandan asked on 12 Jan 2010, 01:50 PM
I used the Telerik reports q3-2009. the report is generated code behind from database. i

need to connect the Chart from database in code behind. the data is not populated let me

know how can i solved this problem . please give me the sample code and reference.

I used the code below like this


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

            OrderManager orderManager = new OrderManager();
            List<OrderData> AgeementNotAgreeedList = new List<OrderData>();
            AgeementNotAgreeedList = orderManager.GetRentalAgreementReportsNotAgreed();
            this.DataSource = AgeementNotAgreeedList;


           
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        private void chart1_NeedDataSource(object sender, EventArgs e)
        {
        

            OrderManager orderManager = new OrderManager();
            List<OrderData> AgeementNotAgreeedList = new List<OrderData>();
            AgeementNotAgreeedList = orderManager.GetRentalAgreementReportsNotAgreed();
            this.DataSource = AgeementNotAgreeedList;            

            Telerik.Reporting.Processing.Chart procChart =

(Telerik.Reporting.Processing.Chart)sender;
          
            chart1.Series[0].DataYColumn = "id";
            chart1.PlotArea.XAxis.DataLabelsColumn = "id";
            // assign appearance related properties
            chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300;
            chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color =

System.Drawing.Color.BlueViolet;
            chart1.PlotArea.Appearance.Dimensions.Margins.Bottom =
            Telerik.Reporting.Charting.Styles.Unit.Percentage(30);
            
        }

        private void chart2_NeedDataSource(object sender, EventArgs e)
        {
        

            OrderManager orderManager = new OrderManager();
            List<OrderData> AgeementNotAgreeedList = new List<OrderData>();
            AgeementNotAgreeedList = orderManager.GetRentalAgreementReportsNotAgreed();
         
            this.DataSource = AgeementNotAgreeedList;  
            chart2.Series[0].DataYColumn = "QuantityInStock";
            chart2.PlotArea.XAxis.DataLabelsColumn = "Name";
            chart2.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font
             = new System.Drawing.Font("Ariel", 8);
            
        }

        private void chart3_NeedDataSource(object sender, EventArgs e)
        {
            OrderManager orderManager = new OrderManager();
            List<OrderData> AgeementNotAgreeedList = new List<OrderData>();
            AgeementNotAgreeedList = orderManager.GetRentalAgreementReportsNotAgreed();
            this.DataSource = AgeementNotAgreeedList;
            chart1.Series[0].DataYColumn = "id";
            chart1.PlotArea.XAxis.DataLabelsColumn = "RenterName";
            // assign appearance related properties
            chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300;
            chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color =

System.Drawing.Color.BlueViolet;
            chart1.PlotArea.Appearance.Dimensions.Margins.Bottom =
            Telerik.Reporting.Charting.Styles.Unit.Percentage(30);
        }

    }    
}


Let me know how can i solved this problem. i used the telerik q3-2009.

Thanks
G.  Manikandan

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
mani kandan
Top achievements
Rank 1
Share this question
or