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

RadChart MOSS 2007 WebPart

1 Answer 64 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
talha
Top achievements
Rank 1
talha asked on 09 Sep 2010, 11:51 AM
sing System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using System.Drawing;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using Telerik.WebControls;
using Telerik.WebControls.Dialogs;
using Telerik.Charting;
using Telerik.Charting.Styles;
namespace telerik
{
    [Guid("fabcf876-e087-4609-8c4c-b236a86750c7")]
    public class telchart : Microsoft.SharePoint.WebPartPages.WebPart
    {
        private bool _error = false;
        private string _myProperty = null;
       
        
 
 
         
 
 
        [Personalizable(PersonalizationScope.Shared)]
        [WebBrowsable(true)]
        [System.ComponentModel.Category("My Property Group")]
        [WebDisplayName("MyProperty")]
        [WebDescription("Meaningless Property")]
        public string MyProperty
        {
            get
            {
                if (_myProperty == null)
                {
                    _myProperty = "Hello SharePoint";
                }
                return _myProperty;
            }
            set { _myProperty = value; }
        }
 
      
        public telchart()
        {
            this.ExportMode = WebPartExportMode.All;
        }
 
 
 
        /// <summary>
        /// Create all your controls here for rendering.
        /// Try to avoid using the RenderWebPart() method.
        /// </summary>
        ///
 
 
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            RenderChildren(writer);
             
 
 
        }
 
 
 
 
 
        protected override void CreateChildControls()
        {
            if (!_error)
            {
                try
                {
 
                    base.CreateChildControls();
 
 
 
 
                    base.CreateChildControls();
                    RadChart myc = new RadChart();
                    ChartSeries mcs = new ChartSeries();
                    mcs.Type = ChartSeriesType.Pie;
 
 
                    myc.RadControlsDir = "~/_layouts/RadControls/";
                    Controls.Add(myc); 
                     
                   
 
 
 
 
 
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }
        }
 
        /// <summary>
        /// Ensures that the CreateChildControls() is called before events.
        /// Use CreateChildControls() to create your controls.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            if (!_error)
            {
                try
                {
                    base.OnLoad(e);
                    this.EnsureChildControls();
 
                     
                     
 
 
 
 
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }
        }
 
        /// <summary>
        /// Clear all child controls and add an error message for display.
        /// </summary>
        /// <param name="ex"></param>
        private void HandleException(Exception ex)
        {
            this._error = true;
            this.Controls.Clear();
            this.Controls.Add(new LiteralControl(ex.Message));
        }
    }
}
hello,

im developing a telerik chart web part in moss 2007, here is the code

the problem is that when the web part loads im not getting any image of a chart ive attached a jpeg image...

any suggestions ? thanks


1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 14 Sep 2010, 06:28 PM
Hi talha,

Please, check the "Integrating RadControls in Sharepoint" section of our online help. In addition, here are some general hints about RadChart -- make sure the chart httphandler is correctly registered in your moss site web.config file. In this page you can find details about extending your moss site with MS ASP.NET AJAX. In a similar manner, you need to add this line to the <httphandlers> section:

<add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>

RadChart uses an additional namespace -- Telerik.Charting, you may need to add an additional tag in the safe controls section.

In addition, RadChart needs the SessionState by default. If you have disabled it - you may configure RadChart not to use it. You can find more details here.

Finally, you can check this forum thread, discussing RadChart and MOSS. Hope this helps.

Greetings,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart (Obsolete)
Asked by
talha
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or