[CLOSED] Production issue, error when parsing chart

  1. #1

    [CLOSED] Production issue, error when parsing chart

    Hello

    In this example :

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Drawing" %>
    <%@ Import Namespace="System.IO" %>
    
    <script runat="server">
        protected void DataSet1(object sender, DirectEventArgs e)
        {
            this.chartTop10Country.GetStore().DataSource = this.DS1;
            this.chartTop10Country.GetStore().DataBind();
            this.chartTop10Country.Call("refreshLegendStore");
        }
    
        protected void DataSet2(object sender, DirectEventArgs e)
        {
            this.chartTop10Country.GetStore().DataSource = this.DS2;
            this.chartTop10Country.GetStore().DataBind();
            this.chartTop10Country.Call("refreshLegendStore");
        }
    
    
        private object[] DS1
        {
            get
            {
                return new object[]
                {
                    new object[] { "A", 71.72 },
                    new object[] { "B", 29.01 },
                    new object[] { "C", 83.81 },
                    new object[] { "D", 52.55 }
                };
            }
        }
    
        private object[] DS2
        {
            get
            {
                return new object[]
                {
                    new object[] { "E", 30 },
                    new object[] { "F", 45 },
                    new object[] { "G", 25 },
                    new object[] { "H", 10 }
                };
            }
        }
    
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <h1>Refresh legend sample</h1>
    
            <ext:Panel
                runat="server"
                Title="Area Chart"
                Width="800"
                Height="600"
                Layout="FitLayout">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:ToolbarFill runat="server" />
    
                            <ext:Button
                                runat="server"
                                Text="Dataset 1"
                                Icon="ArrowRefresh"
                                OnDirectClick="DataSet1" />
                            <ext:Button
                                runat="server"
                                Text="DataSet 2"
                                Icon="ArrowRefresh"
                                OnDirectClick="DataSet2" />
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:PolarChart
                        ID="chartTop10Country"
                        runat="server"
                        Shadow="true"
                        InsetPadding="60"
                        InnerPadding="20">
                        <LegendSpriteConfig runat="server" />
                        <Store>
                            <ext:Store
                                runat="server"
                                AutoDataBind="true">
                                <Model>
                                    <ext:Model runat="server">
                                        <Fields>
                                            <ext:ModelField Name="Country" />
                                            <ext:ModelField Name="Created" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <Interactions>
                            <ext:ItemHighlightInteraction />
                            <ext:RotateInteraction />
                        </Interactions>
                        <Series>
                            <ext:Pie3DSeries
                                AngleField="Created"
                                ShowInLegend="true"
                                Colors="#00FFFF,#2BFFD4,#55FFAA,#80FF7F"
                                Donut="30">
                                <Label Field="Country" Display="Rotate" FontSize="18" FontFamily="Arial" />
                            </ext:Pie3DSeries>
                        </Series>
                    </ext:PolarChart>
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
    It works well in development environment, but whan I put it in production , I get this error message :
    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Cannot create an object of type 'System.String[]' from its string representation '#00FFFF,#2BFFD4,#55FFAA,#80FF7F' for the 'Colors' property.

    Source Error:


    Line 115: </Interactions>
    Line 116: <Series>
    Line 117: <ext:Pie3DSeries
    Line 118: AngleField="Created"
    Line 119: ShowInLegend="true"
    So, what happened?
    Last edited by fabricio.murta; Jun 27, 2017 at 3:09 PM.
  2. #2
    Hello @feanor91!

    The first thought I have is that the server might be running one or more unmatched libraries' or .NET framework versions.

    Ext.NET uses System.Web.UI.WebControls.StringArrayConverter to convert the string of colors into an array of color strings when output. Maybe the version on your host does not support it for some reason.

    If you can do that, I suggest you create a temporary website (virtual directory) from your host and try hosting the Examples Explorer (EE).

    Specific paths that provide examples with the same Colors= usage would be /Examples/Chart/Gauge/Basic_1/, and /Examples/Chart/Combination/Custom_Theme/.

    If you choose trying to host EE, and if you publish the EE using VS' publish tool, the source view functionality won't work. You have to publish by copying the whole src/* folder into the host's root (virtual directory). .csproj, and .cs files on /src, as well as the /bin subfolders (only the files immediately on bin) can be excluded from the copy. Other than that, publish also the .cs files under the subfolders.

    In fact, I have just tested your example under IIS, and it worked just fine. I'm pretty confident this is not an Ext.NET-specific issue, so there are probably information on this out there on the web.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks, I will investigate and report.
  4. #4
    Hi

    I finally find a solution : I upgrated all .Net version in all solutions'project to 4.5 and it works...
  5. #5
    Hello @feanor91! Glad you could sort out the issue!

    Please, if you don't mind, would you let us know from which .NET version you upgraded? 4.0? We may have used something that wouldn't be compatible with that at some point, and if that was important, we may start discussing either making the code adequate for such a version or discontinuing support for that (if that's a very old version, for example).
    Fabrício Murta
    Developer & Support Expert
  6. #6
    I have some project in the solution with 3.5, others with 4 and most recent in 4.5, I upgrade it all in 4.5
  7. #7
    Hello! Thanks for the follow-up! Indeed, .NET 3.5 is not supported so that would be expected problems if using that version.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 9
    Last Post: Oct 07, 2013, 11:41 PM
  2. [CLOSED] Deserilization Parsing Error with Double Quotes
    By vzx in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 19, 2013, 6:21 PM
  3. [CLOSED] IE8: HTML Parsing Error
    By jsdeveloper in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Feb 22, 2011, 1:36 PM
  4. [CLOSED] [1.0] Json Webservice DateTime Parsing Error
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 04, 2010, 1:10 AM
  5. Replies: 0
    Last Post: Oct 15, 2009, 3:10 AM

Posting Permissions