Example #1
0
        /// <summary>Generate one report. The type of report generated is specified in the ReportTemplate.</summary>
        public static ZoomReportBase Report(League league, bool includeSecret, ReportTemplate rt)
        {
            bool description = rt.Settings.Contains("Description");

            switch (rt.ReportType)
            {
            case ReportType.TeamLadder: return(Reports.TeamLadder(league, includeSecret, rt));

            case ReportType.MultiLadder: return(Reports.MultiLadder(league, includeSecret, rt));

            case ReportType.TeamsVsTeams: return(Reports.TeamsVsTeams(league, includeSecret, rt));

            case ReportType.ColourPerformance: return(Reports.ColourReport(new List <League> {
                    league
                }, includeSecret, rt));

            case ReportType.SoloLadder: return(Reports.SoloLadder(league, includeSecret, rt));

            case ReportType.GameByGame: return(Reports.GamesList(league, includeSecret, rt));

            case ReportType.GameGrid:
            case ReportType.Ascension:
            case ReportType.Pyramid:
                return(Reports.GamesGrid(league, includeSecret, rt));

            case ReportType.GameGridCondensed:
            case ReportType.PyramidCondensed:
                return(Reports.GamesGridCondensed(league, includeSecret, rt));

            case ReportType.Packs:
                return(Reports.PackReport(new List <League> {
                    league
                }, league.Games(includeSecret), rt.Title, rt.From, rt.To,
                                          ChartTypeExtensions.ToChartType(rt.Setting("ChartType")), description, rt.Settings.Contains("Longitudinal")));

            case ReportType.Tech:
                return(Reports.TechReport(new List <League> {
                    league
                }, rt.Title, rt.From, rt.To,
                                          ChartTypeExtensions.ToChartType(rt.Setting("ChartType")), description));

            case ReportType.SanityCheck:
                return(Reports.SanityReport(new List <League> {
                    league
                }, rt.Title, rt.From, rt.To, description));

            case ReportType.Everything: return(Reports.EverythingReport(league, rt.Title, rt.From, rt.To, description));

            case ReportType.PageBreak: return(new ZoomSeparator());

            default: return(null);
            }
        }
Example #2
0
        /// <summary>Write a single pack report incorporating data from all the selected leagues.</summary>
        public static void PackReport(string path, List <League> leagues, ReportTemplate reportTemplate, OutputFormat outputFormat)
        {
            if (path != null)
            {
                var round1Games = new List <Game>();
                foreach (var league in leagues)
                {
                    round1Games.AddRange(league.AllGames.Where(g => g.Title == "Round Robin" || g.Title == "Round 1" ||
                                                               g.Title == "Rep 1" || g.Title == "Repechage 1"));
                }

                if (round1Games.Count == 0)
                {
                    foreach (var league in leagues)
                    {
                        round1Games.AddRange(league.AllGames);
                    }
                }

                using (StreamWriter sw = File.CreateText(Path.Combine(path, "packreport." + outputFormat.ToExtension())))
                    sw.Write(new ZoomReports
                    {
                        Reports.PackReport(leagues, round1Games, reportTemplate.Title, reportTemplate.From, reportTemplate.To,
                                           ChartTypeExtensions.ToChartType(reportTemplate.Setting("ChartType")), reportTemplate.Settings.Contains("Description"), reportTemplate.Settings.Contains("Longitudinal"))
                    }.ToOutput(outputFormat));
            }
        }
Example #3
0
 /// <summary>Write a single pack report incorporating data from all the selected leagues.</summary>
 public static void TechReport(string path, List <League> leagues, ReportTemplate reportTemplate, OutputFormat outputFormat)
 {
     if (path != null)
     {
         using (StreamWriter sw = File.CreateText(Path.Combine(path, "techreport." + outputFormat.ToExtension())))
             sw.Write(new ZoomReports
             {
                 Reports.TechReport(leagues, reportTemplate.Title, reportTemplate.From, reportTemplate.To,
                                    ChartTypeExtensions.ToChartType(reportTemplate.Setting("ChartType")), reportTemplate.Settings.Contains("Description"))
             }.ToOutput(outputFormat));
     }
 }
Example #4
0
        /// <summary>Generate one report. The type of report generated is specified in the ReportTemplate.</summary>
        public static ZoomReportBase Report(List <League> leagues, bool includeSecret, ReportTemplate rt)
        {
            bool description = rt.Settings.Contains("Description");

            switch (rt.ReportType)
            {
            case ReportType.ColourPerformance:
                return(Reports.ColourReport(leagues, includeSecret, rt));

            case ReportType.Packs:
                return(Reports.PackReport(leagues, null, rt.Title, rt.From, rt.To,
                                          ChartTypeExtensions.ToChartType(rt.Setting("ChartType")), description, rt.Settings.Contains("Longitudinal")));

            case ReportType.Tech:
                return(Reports.TechReport(leagues, rt.Title, rt.From, rt.To,
                                          ChartTypeExtensions.ToChartType(rt.Setting("ChartType")), description));

            case ReportType.SanityCheck:
                return(Reports.SanityReport(leagues, rt.Title, rt.From, rt.To, description));

            default: return(Report(leagues.FirstOrDefault(), includeSecret, rt));
            }
        }