PowerTools MultiRow for Windows Forms 8.0J
Conditions プロパティ
使用例 

MultiRowCondition のコレクションを取得します。
構文
Public ReadOnly Property Conditions As MultiRowConditionCollection
public MultiRowConditionCollection Conditions {get;}
解説
Conditions のすべての条件が一致する場合に集計が行われます。
使用例
次のサンプルコードは、特定のセルに対して異なる条件を設定した後、異なるセルの条件を 1 つに集約する方法を示します。
private void SetSummaryCellCondition(SummaryCell summaryCell)
{
    MultiRowCondition multiRowCondition1 = new GrapeCity.Win.MultiRow.MultiRowCondition();
    MultiRowCondition multiRowCondition2 = new GrapeCity.Win.MultiRow.MultiRowCondition();
    MultiRowCondition multiRowCondition3 = new GrapeCity.Win.MultiRow.MultiRowCondition();

    MathStatistics mathStatistics1 = new GrapeCity.Win.MultiRow.MathStatistics();
    mathStatistics1.CellName = "numericUpDownCell2";
    multiRowCondition1.CellName = "numericUpDownCell1";
    multiRowCondition1.Items.Add(new GrapeCity.Win.MultiRow.MultiRowConditionItem(GrapeCity.Win.MultiRow.ConditionalCellStyleOperator.GreaterThan, new decimal(new int[] {
            20,
            0,
            0,
            0}), new decimal(new int[] {
            0,
            0,
            0,
            0})));

    multiRowCondition2.CellName = "textBoxCell3";
    multiRowCondition2.Items.Add(new GrapeCity.Win.MultiRow.MultiRowConditionItem(GrapeCity.Win.MultiRow.ConditionalCellStyleOperator.Equals, "Female", ""));
   
    multiRowCondition3.Items.Add(new GrapeCity.Win.MultiRow.MultiRowConditionItem(GrapeCity.Win.MultiRow.ConditionalCellStyleOperator.Equals, "China", ""));
    multiRowCondition3.Items.Add(new GrapeCity.Win.MultiRow.MultiRowConditionItem(GrapeCity.Win.MultiRow.ConditionalCellStyleOperator.Equals, "US", ""));
   
    mathStatistics1.Conditions.Add(multiRowCondition1);
    mathStatistics1.Conditions.Add(multiRowCondition2);
    mathStatistics1.Conditions.Add(multiRowCondition3);

    summaryCell.Calculation = mathStatistics1;
}
Private Sub SetSummaryCellCondition(ByVal summaryCell As SummaryCell)
    Dim multiRowCondition1 As MultiRowCondition = New MultiRowCondition()
    Dim multiRowCondition2 As MultiRowCondition = New MultiRowCondition()
    Dim multiRowCondition3 As MultiRowCondition = New MultiRowCondition()
    Dim mathStatistics1 As MathStatistics = New MathStatistics
    mathStatistics1.CellName = "numericUpDownCell2"
    multiRowCondition1.CellName = "numericUpDownCell1"
    multiRowCondition1.Items.Add(New MultiRowConditionItem(ConditionalCellStyleOperator.GreaterThan, New Decimal(New Integer() {20, 0, 0, 0}), New Decimal(New Integer() {0, 0, 0, 0})))
    multiRowCondition2.CellName = "textBoxCell3"
    multiRowCondition2.Items.Add(New MultiRowConditionItem(ConditionalCellStyleOperator.Equals, "Female", ""))
    multiRowCondition3.Items.Add(New MultiRowConditionItem(ConditionalCellStyleOperator.Equals, "China", ""))
    multiRowCondition3.Items.Add(New MultiRowConditionItem(ConditionalCellStyleOperator.Equals, "US", ""))
    mathStatistics1.Conditions.Add(multiRowCondition1)
    mathStatistics1.Conditions.Add(multiRowCondition2)
    mathStatistics1.Conditions.Add(multiRowCondition3)
    summaryCell.Calculation = mathStatistics1
End Sub
参照

MathStatistics クラス
MathStatistics メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.