Chart Duplication

  • hi all,

    this chart give me duplicate data i cant solve it any help ???????????and the code shown

     

        var strSQL = "select count(mesh_membershipid) as 'mycount', 'Class 1000' as 'mytype' from membership where mesh_class=0  union select count(mesh_membershipid) as 'mycount', 'Class 3000' as 'mytype' from membership where mesh_class=1 union select count(mesh_membershipid) as 'mycount', 'With no class' as 'mytype' from membership where mesh_class is null";


        var myBlock=CRM.GetBlock("chart");
        with(myBlock)
        {
        Stylename("Pie");
        xlprop="mytype";
        yprop="mycount";
        SQLText= strSQL;
        ImageWidth=950;
        }

     

  • Hi,

     

    I am writing my ASP page as below and get correct data.

     

    <!-- #include file ="crmwizard.js" -->

    <%

    var sContainer=CRM.GetBlock("container");

    var strSQL = "select count(comp_companyid) as 'mycount', 'Class 1000' as 'mytype' from Company where comp_deleted=0 union select count(comp_companyid) as 'mycount', 'Class 3000' as 'mytype' from Company where comp_deleted=1 union select count(comp_companyid) as 'mycount', 'With no class' as 'mytype' from Company where comp_deleted is null";

     

    var myBlock=CRM.GetBlock("chart");

    with(myBlock)

    {

    Stylename("Pie");

    xlprop="mytype";

    yprop="mycount";

    SQLText= strSQL;

    ImageWidth=950;

    }

     

    sContainer.AddBlock(myBlock)

    Response.Write(sContainer.Execute());

    %>

     

    Just replaced your table with standard company entity. Does your view return only 3 rows? If yes, it should work correctly with above code.

     

    Regards,

    Dinesh

    --------------------------------------------------------------------------------------------------------------------------------------
    New Release - Sage CRM for Sage ERP X3 - real-time, bi-directional, anywhere access.
    Celebrating 900+ Sage CRM Posts
    - http://www.greytrix.com/blogs/sagecrm/
    Sage Premier Gold Development Partner - Sage X3, Sage 100/300/500/Pro ERP & Sage CRM
    *Sage CRM Gold Development Partner of the Year 2004 and 2011*
    E-mail: crm@greytrix.com |  Twitter: greytrix

  • thanks  Greytrix  for answer but look to the chart after write your code still duplicate the chart .

    and this is the output of SQL just 3 rows

     

    Best Regards,

  • any solution can help?

  • I tried the same example in CRM 7.1h and I have the same error.

    I found the same error when making a graph of an external table, but I did not care because I thought it was problem of communication with the external table.

    Any idea?

    thanks.