Beispiel #1
0
        private static void createTables(List <Object> listToReport, DataTable table, DataView view, string columnName, string groupByName)
        {
            var entities = table.DefaultView.ToTable(true, columnName).DefaultView;

            entities.Sort = columnName;

            foreach (DataRowView dataRow in entities)
            {
                var value = dataRow[columnName].ToString();
                listToReport.Add(new SubSubSection(value));
                createRowFilter(view, columnName, value);

                view.CheckColumnVisibility(Constants.UNIT);
                view.CheckColumnVisibility(Constants.START_VALUE);
                view.CheckColumnVisibility(Constants.FORMULA);
                view.CheckColumnVisibility(Constants.SCALE_DIVISOR, 1D);

                var tableToReport = view.CreateDataTableWithPreservedChildRelations().DefaultView;
                tableToReport.Sort = Constants.MOLECULE_NAME;
                listToReport.Add(new Table(tableToReport, String.Format("{0} for {1} {2}", Constants.MOLECULE_START_VALUES, groupByName, value)));
            }
        }