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

Issues with the object of Telerik.Reporting.Chart ChartMarkedZone

1 Answer 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cris
Top achievements
Rank 1
Cris asked on 21 Sep 2011, 10:12 PM
We are having trouble adding more than one ChartMarkedZone object in a chart implemented in a Windows Server 2003 and therefore with IIS6, the messages from a error says something like "Attempted to read or write protected memory. This is an indication That Often other memory is corrupt. "or else "A generic error occurred in GDI +"
This problem does not occur in IIS7 but we can not force the client to update the version of Internet Information Services.

ReportPrueba.cs
namespace SmartWork.ReportsManagementControl.ReportsLogic
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
    using Telerik.Reporting.Charting;
    using System.Collections.Generic;

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

        private void chart_MesMinisterio_NeedDataSource(object sender, EventArgs e)
        {
            List<PruebaObject> lstPrueba = new List<PruebaObject>();
            lstPrueba.Add(new PruebaObject() { Codigo = 1, Dia = 1, Value = 24 });
            lstPrueba.Add(new PruebaObject() { Codigo = 2, Dia = 5, Value = 48 });
            lstPrueba.Add(new PruebaObject() { Codigo = 3, Dia = 10, Value = 32 });

            chart_MesMinisterio.DataSource = lstPrueba;
            chart_MesMinisterio.Series[0].DataLabelsColumn = "Value";
            chart_MesMinisterio.Series[0].DataXColumn = "Dia";
            chart_MesMinisterio.Series[0].DataYColumn = "Value";
            chart_MesMinisterio.IntelligentLabelsEnabled = true;
            chart_MesMinisterio.Series[0].Appearance.ShowLabelConnectors = true;
            chart_MesMinisterio.Series[0].Appearance.LineSeriesAppearance.Width = 3;
            chart_MesMinisterio.Series[0].Appearance.LineSeriesAppearance.Color = Color.LightSteelBlue;

            chart_MesMinisterio.PlotArea.YAxis.AutoScale = false;
            chart_MesMinisterio.PlotArea.YAxis.MinValue = 0;
            chart_MesMinisterio.PlotArea.YAxis.MaxValue = 100;
            chart_MesMinisterio.PlotArea.XAxis.AutoScale = false;
            chart_MesMinisterio.PlotArea.XAxis.MinValue = 1;
            chart_MesMinisterio.PlotArea.XAxis.MaxValue = 31;
            chart_MesMinisterio.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 270;
            chart_MesMinisterio.PlotArea.Appearance.Dimensions.Margins.Bottom
                = new Telerik.Reporting.Charting.Styles.Unit(14, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chart_MesMinisterio.PlotArea.Appearance.Dimensions.Margins.Top
                = new Telerik.Reporting.Charting.Styles.Unit(10, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chart_MesMinisterio.PlotArea.Appearance.Dimensions.Margins.Left
                = new Telerik.Reporting.Charting.Styles.Unit(8, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chart_MesMinisterio.PlotArea.Appearance.Dimensions.Margins.Right
                = new Telerik.Reporting.Charting.Styles.Unit(5, Telerik.Reporting.Charting.Styles.UnitType.Percentage);

            ChartMarkedZone maxMin = new ChartMarkedZone();
            maxMin.ValueStartY = 75;
            maxMin.ValueEndY = 75;
            maxMin.Label.TextBlock.Text = "Maximo: 75";
            maxMin.Appearance.Border.Color = Color.Green;
            maxMin.Appearance.Border.Width = 2;
            chart_MesMinisterio.PlotArea.MarkedZones.Add(maxMin);

            ChartMarkedZone avgMin = new ChartMarkedZone();
            avgMin.ValueStartY = 50;
            avgMin.ValueEndY = 50;
            avgMin.Label.TextBlock.Text = "Promedio: 50";
            avgMin.Appearance.Border.Color = Color.Red;
            avgMin.Appearance.Border.Width = 2;
            chart_MesMinisterio.PlotArea.MarkedZones.Add(avgMin);
        }
    }

    public class PruebaObject
    {
        public int Codigo { get; set; }
        public int Dia { get; set; }
        public int Value { get; set; }
    }
}

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 26 Sep 2011, 11:51 AM
Hi Christian,

Unfortunately we could not reproduce the error on our end with the provided code, but we have a suspicion.
Generally such a problem can be caused due to the limited stack size of IIS (250kb) while the Casini server has a higher stack limit (around 1MB) and that is why it works locally. Try increasing the IIS stack and also after researching on the problem we found out that setting Enable 32-Bit Applications in the ASP.NET's application pool should also have an effect so you might try this as well.

If the above do not change anything, please provide us with a runnable project that exhibits the problem under IIS 6 and we would be able to advise you.

Greetings,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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