0

に関して 2 つの質問/問題がありAspxPivotGridます。

カスタマイズ ウィンドウを使用して、「行領域」と「データ領域」に列を追加し、レポートを更新すると。グリッドは正しく生成されますが、グラフは生成されません。ただし、「列領域」にフィールドを追加すると、グラフが生成されます。

「データ領域」ヘッダーがまさに必要なデータであるにもかかわらず、少なくとも列が指定されている場合にのみグラフが生成されるようです。あなたのサイトにあるグラフのデモでこれをシミュレートしました。これは予想される動作ですか?

次に、DateTime を「行領域」と文字列の「列領域」に追加すると問題ありません。次に、列を入れ替えます。再びピボットは問題ありません。もう一度元に戻すと、次のエラーが表示されます。

System.ArgumentException: The type of the "Arguments" argument data member isn't compatible with the date-time scale.

at DevExpress.XtraCharts.SeriesBase.CheckArgumentDataMember(Object dataSource, String dataMember, ScaleType argumentScaleType)

提案/解決策はありますか?

4

2 に答える 2

1

「行領域」と「データ領域」にフィールドがあり、「列領域」にはフィールドがない場合、グリッドには列の総計が表示されます。ShowColumnGrandTotalsプロパティを設定することで、これらをチャートに表示できます。

ASPxPivotGrid1.OptionsChartDataSource.ShowColumnGrandTotals = True

ほとんどのグラフは次のいずれかを表示するため、総計を表示しないというデフォルト値は理解できます。

  • 行フィールドまたは列フィールドでグループ化された集計値で、総計がない、または
  • 行または列の総計値のみ。
于 2011-06-10T14:12:38.913 に答える
0

私は同じエラーを抱えていました:

"Arguments" 引数データ メンバーの型は、数値スケールと互換性がありません

"Arguments" 引数データ メンバーの型は、日時スケールと互換性がありません

ユーザーがピボット グリッドで行を列ごと、またはその逆に変更したときに発生していました。この問題を回避するために、私はこのコードを試しました。

        //Always make the chart visible then perform DataBind() //Sempre deixar o gráfico visivel e depois executar o método DataBind()
        try
        {
            dxGrafico.Visible = true;
            dxGrafico.RefreshData();
            dxGrafico.DataBind();
        }
        catch (Exception ex)
        {
            //Try to fix the error: The type of the "Arguments" argument data member isn't compatible with the <data type> scale //Tentar corrigir o Erro
            bool bTeste = false;
            bTeste = Ajuste_Grafico_ScaleType(ex);

            //If not fix the argument scale type, then show error message label //Se não conseguir corrigir , acrescenta um label com texto da mensagem de erro
            if (!bTeste)
            {
                //Make the chart not visible and Add a label on the Page Control that the owners the chart //Deixar o gráfico invisível e exibir o label com mensagem no objeto PageControl que contém o gráfico
                dxGrafico.Visible = false;
                try
                {
                    //Error Message (Mensagem de Erro)    
                    ASPxLabel lbl = new ASPxLabel();
                    lbl.ID = "lblMensagemErroGrafico";
                    lbl.Text += "\n\n" + "ATENÇÃO: Não Foi possível Processar o Gráfico" + "";
                    lbl.Text += "\n\n" + "Tente utilizar outro tipo de Gráfico" + "";
                    lbl.Text += "\n\n" + ex.Message + ""; //lbl.Text += "\n\n" + ex.ToString() + "";
                    this.pgControl.TabPages[1].Controls.Add(lbl);
                }
                catch (Exception ex1) { }
            }

        }

    //method Try to fix the error 
    private bool Ajuste_Grafico_ScaleType(Exception exOrigem)
    {
        //Try to fix error argument ArgumentScaleType (Tenta ajustar erro)
        bool saida = false;

        try
        {

            //Auto
            try
            {
                dxGrafico.SeriesTemplate.ArgumentScaleType = ScaleType.Auto;
                dxGrafico.DataBind();
                dxGrafico.SeriesTemplate.ValueScaleType = ScaleType.Auto;
                dxGrafico.DataBind();
                saida = true;
                return saida;
            }
            catch (Exception e) { }

            //Numeric
            try
            {
                int n = exOrigem.Message.ToString().IndexOf("Numeric", 0, StringComparison.OrdinalIgnoreCase);
                if (n >= 0)
                {
                    dxGrafico.SeriesTemplate.ArgumentScaleType = ScaleType.DateTime;
                    dxGrafico.DataBind();
                    dxGrafico.SeriesTemplate.ValueScaleType = ScaleType.DateTime;
                    dxGrafico.DataBind();
                    saida = true;
                    return saida;
                }
            }
            catch (Exception e) { }


            //Date Time
            try
            {
                int n = exOrigem.Message.ToString().IndexOf("Date", 0, StringComparison.OrdinalIgnoreCase);
                if (n >= 0)
                {
                    dxGrafico.SeriesTemplate.ArgumentScaleType = ScaleType.Numerical;
                    dxGrafico.DataBind();
                    dxGrafico.SeriesTemplate.ValueScaleType = ScaleType.Numerical;
                    dxGrafico.DataBind();
                    saida = true;
                    return saida;
                }
            }
            catch (Exception e) { }

        }
        finally
        {

        }

        return false;
    }

ほとんどのチャート タイプで機能しますが、FullStakedLineここでは関係のない別のエラーが発生しました。

于 2013-04-25T00:26:08.927 に答える