public static void MakeOverviewReports(this classificationReportCollection reportCollection, classificationReportCollectionSettings settings, aceAuthorNotation appInfo, ILogBuilder log, String name = "", String description = "") { classificationReportDataComplexContext context = new classificationReportDataComplexContext(); DataTableConverterASCII dataTableConverterASCII = new DataTableConverterASCII(); classificationReportStyleDefinition style = classificationReportStyleDefinition.GetDefault(settings.style.groups); if (reportCollection.name.isNullOrEmpty()) { reportCollection.name = name; } if (description.isNullOrEmpty()) { reportCollection.description += description; } MakeReport(reportCollection, settings, appInfo, log, style, context); //reportSpace.ConstructTable("cumulative_" + reportCollection.name, reportCollection.description, style); foreach (var pair in reportCollection.Children) { MakeReport(pair.Value, settings, appInfo, log, style, context); } foreach (var pair in context.comparative_tables) { var comparative_table = pair.Value.GetRowCollectionTable("complete_summary_" + pair.Key); //context.comparative_tables.GetRowCollectionTable("complete_comparative"); comparative_table.SetTitle("complete_summary_" + pair.Key); comparative_table.GetReportAndSave(reportCollection.rootFolder, appInfo); } foreach (var pair in context.comparative_narrow_tables) { var comparative_table = pair.Value.GetRowCollectionTable("complete_summary_ascii" + pair.Key); //context.comparative_tables.GetRowCollectionTable("complete_comparative"); comparative_table.SetTitle("complete_summary_ascii" + pair.Key); dataTableConverterASCII.ConvertToFile(comparative_table, reportCollection.rootFolder, comparative_table.TableName + "_ascii.txt", DataTableConverterASCIISettings.GetCommaSeparatedValues()); //builderForText bt = new builderForText(); //bt.AppendTable(comparative_table); //bt.GetContent().saveStringToFile(reportCollection.rootFolder.pathFor(comparative_table.TableName + "_ascii.txt", Data.enums.getWritableFileMode.overwrite, "ASCII export of comparative table")); comparative_table.GetReportAndSave(reportCollection.rootFolder, appInfo); } var overview_table = context.overview_tables.GetRowCollectionTable("complete_overview"); overview_table.SetTitle("complete_overview"); overview_table.GetReportAndSave(reportCollection.rootFolder, appInfo); //.GetAggregatedTable("summary", Core.math.aggregation.dataPointAggregationAspect.subSetOfRows, log); }
/// <summary> /// Publishes the table blocks. /// </summary> /// <param name="folder">The folder.</param> /// <param name="blockSize">Size of the block.</param> /// <param name="blockCount">The block count.</param> /// <returns></returns> public DataTableTypeExtended <FeatureCWPFrequencies> PublishTableBlocks(folderNode folder, Int32 blockSize = 500, Int32 blockCount = 10) { if (!this.Any()) { return(null); } foreach (var pair in this) { pair.Value.Compute(); } Int32 b = 0; for (int i = 0; i < blockCount; i++) { var p = this.First(); String dt_n = name + "_" + i.ToString(); DataTableTypeExtended <FeatureCWPFrequencies> cwpMetrics = new DataTableTypeExtended <FeatureCWPFrequencies>(dt_n, "Collected metrics"); // DataTableTypeExtended<FeatureCWPFrequencies> cwpFrequencies = new DataTableTypeExtended<FeatureCWPFrequencies>(dt_n + "_freq", "frequency metrics"); // p.Value.SetDataTable(datatable); // DataColumn nm = datatable.Columns.Add("Name"); Int32 c = 0; foreach (var pair in this) { if (c > (i * blockSize) && c < (i + 1) * blockSize) { cwpMetrics.AddRow(pair.Value); // cwpFrequencies.AddRow(term_finders.) } c++; } if (cwpMetrics.Rows.Count > 0) { DataTableConverterASCII dataTableConverterASCII = new DataTableConverterASCII(); dataTableConverterASCII.ConvertToFile(cwpMetrics, folder, dt_n); DataTableForStatistics report = cwpMetrics.GetReportAndSave(folder, null, dt_n); } } DataTableTypeExtended <FeatureCWPFrequencies> output = new DataTableTypeExtended <FeatureCWPFrequencies>(); foreach (var p in this) { output.AddRow(p.Value); } output.Save(folder, null, "stats_frequencies"); return(output); }
/// <summary> /// Gets the report and save. /// </summary> /// <param name="input">The input.</param> /// <param name="folder">The folder.</param> /// <param name="notation">The notation.</param> /// <param name="fileprefix">The fileprefix.</param> /// <returns></returns> public static List <DataTableForStatistics> GetReportAndSave(this Dictionary <String, DataTable> input, folderNode folder, aceAuthorNotation notation, String fileprefix = "", DataTableConverterASCII converter = null) { List <DataTableForStatistics> output = new List <DataTableForStatistics>(); foreach (var pair in input) { String p_m = folder.pathFor(fileprefix + pair.Key); output.Add(pair.Value.GetReportAndSave(folder, notation, fileprefix + pair.Key)); if (converter != null) { converter.ConvertToFile(pair.Value, folder, pair.Value.TableName, DataTableConverterASCIISettings.GetCommaSeparatedValues()); } } return(output); }