Пример #1
0
        private IReportTable <ReportCell> BuildReport()
        {
            ReportCellProperty  centerAlignment = new AlignmentProperty(Alignment.Center);
            BoldProperty        bold            = new BoldProperty();
            IndentationProperty indentation     = new IndentationProperty();

            HorizontalReportSchemaBuilder <Entity> reportBuilder = new HorizontalReportSchemaBuilder <Entity>();

            reportBuilder.AddGlobalProperties(centerAlignment);

            reportBuilder
            .AddHeaderRow(string.Empty, e => e.Name)
            .AddProperties(centerAlignment);
            reportBuilder.AddRow("Age", e => e.Age)
            .AddHeaderProperties(bold);
            reportBuilder.AddRow(new EmptyCellsProvider <Entity>("Score"))
            .AddHeaderProperties(bold);
            reportBuilder.AddRow("Min. Score", e => e.MinScore)
            .AddHeaderProperties(indentation);
            reportBuilder.AddRow("Max. Score", e => e.MaxScore)
            .AddHeaderProperties(indentation);
            reportBuilder.AddRow("Avg. Score", e => e.AverageScore)
            .AddHeaderProperties(indentation)
            .AddProperties(new DecimalPrecisionProperty(2));

            return(reportBuilder.BuildSchema().BuildReportTable(this.GetData()));
        }
        private IReportTable <ReportCell> BuildReport()
        {
            ReportCellProperty centerAlignment = new AlignmentProperty(Alignment.Center);
            BoldProperty       bold            = new BoldProperty();

            HorizontalReportSchemaBuilder <Entity> reportBuilder = new HorizontalReportSchemaBuilder <Entity>();

            reportBuilder.AddGlobalProperties(centerAlignment);
            reportBuilder
            .AddHeaderRow("Metrics", e => e.Name)
            .AddProperties(centerAlignment)
            .AddHeaderProperties(centerAlignment);
            reportBuilder.AddRow("Age", e => e.Age)
            .AddHeaderProperties(bold);
            reportBuilder.AddRow("Min. Score", e => e.MinScore);
            reportBuilder.AddRow("Max. Score", e => e.MaxScore);
            reportBuilder.AddRow("Avg. Score", e => e.AverageScore)
            .AddProperties(new DecimalPrecisionProperty(2));

            reportBuilder.AddComplexHeader(0, "Score", "Min. Score", "Avg. Score");
            reportBuilder.AddComplexHeaderProperties("Score", new ColorProperty(Color.Blue));

            return(reportBuilder.BuildSchema().BuildReportTable(this.GetData()));
        }