Example #1
0
        /// <summary>
        /// Populate a single value table. This is used when all keys are slice keys.
        /// </summary>
        /// <param name="model">
        /// The model to render
        /// </param>
        /// <param name="table">
        /// The html table to populate
        /// </param>
        private static void GetSingleValue(IDataSetModel model, HtmlEntityParent <TableRow> table)
        {
            if (model.GetRowCount(true) > 1)
            {
                throw new DataSetRendererException(
                          "There are no horizontal & vertical keys, but the number of " + "values from model is "
                          + model.GetRowCount(true) + " instead of 1");
            }

            table.AddElement(
                model.GetRowCount(true) == 0
                    ? new TableRow(new TableCell(" "))
                    : new TableRow(new TableCell(model.FirstObservation)));
        }
        /// <summary>
        /// Populate a single value table. This is used when all keys are slice keys.
        /// </summary>
        /// <param name="model">
        /// The model to render
        /// </param>
        /// <param name="table">
        /// The html table to populate
        /// </param>
        private static void GetSingleValue(IDataSetModel model, HtmlEntityParent<TableRow> table)
        {
            if (model.GetRowCount(true) > 1)
            {
                throw new Exception(
                    "There are no horizontal & vertical keys, but the number of " + "values from model is "
                    + model.GetRowCount(true) + " instead of 1");
            }

            table.AddElement(
                model.GetRowCount(true) == 0
                    ? new TableRow(new TableCell(" "))
                    : new TableRow(new TableCell(float.Parse(model.FirstObservation.ToString().Replace('.', ',')).ToString())));
        }