コード例 #1
0
        public static void SetAndGetValueOfCellA1()
        {
            #region radspreadsheet-features-formulas_0
            Workbook workbook = new Workbook();
            workbook.Worksheets.Add();
            workbook.ActiveWorksheet.Cells[0, 0].SetValue("=3+4");
            #endregion

            #region radspreadsheet-features-formulas_1
            FormulaCellValue formulaCellValue = workbook.ActiveWorksheet.Cells[0, 0].GetValue().Value as FormulaCellValue;
            if (formulaCellValue != null)
            {
                RadExpression expression = formulaCellValue.Value;
                //expression is AdditionExpression with operands 3 and 4

                CellValueFormat format        = workbook.ActiveWorksheet.Cells[0, 0].GetFormat().Value;
                string          valueAsString = formulaCellValue.GetValueAsString(format);
                //valueAsString = "=3+4"

                string resultValueAsString = formulaCellValue.GetResultValueAsString(format);
                //resultAsString = "7"

                CellValueType valueType = formulaCellValue.ValueType;
                //valueType = Formula

                CellValueType resultValueType = formulaCellValue.ResultValueType;
                //resultValueType = Number
            }
            #endregion
        }
コード例 #2
0
ファイル: E.cs プロジェクト: Motaz-Al-Zoubi/xaml-sdk
 protected override RadExpression EvaluateOverride(RadExpression[] arguments)
 {
     return NumberExpression.E;
 }
コード例 #3
0
ファイル: Arguments.cs プロジェクト: Motaz-Al-Zoubi/xaml-sdk
 protected override RadExpression EvaluateOverride(RadExpression[] arguments)
 {
     return new NumberExpression(arguments.Length);
 }