Example #1
0
        public void Render()
        {
            //  might have to load some stuff first ???

            var str = new SimpleTableReport( "Game Summary " + Game.ScoreOut() );
            str.AddDenisStyle();
            str.SubHeader = SubHeading();
            str.AnnounceIt = true;
            str.AddColumn( new ReportColumn( "C1", "COL01", "{0}" ) );
            str.AddColumn( new ReportColumn( "C2", "COL02", "{0}" ) );
            str.AddColumn( new ReportColumn( "C3", "COL03", "{0}" ) );
            str.AddColumn( new ReportColumn( "C4", "COL04", "{0}" ) );
            str.AddColumn( new ReportColumn( "C5", "COL05", "{0}" ) );
            str.AddColumn( new ReportColumn( "C6", "COL06", "{0}" ) );
            str.AddColumn( new ReportColumn( "C7", "COL07", "{0}" ) );
            str.AddColumn( new ReportColumn( "C8", "COL08", "{0}" ) );
            str.AddColumn( new ReportColumn( "C9", "COL09", "{0}" ) );
            str.AddColumn( new ReportColumn( "C10", "COL10", "{0}" ) );
            str.AddColumn( new ReportColumn( "C11", "COL11", "{0}" ) );

            str.CustomHeader = SummaryHeader();

            str.LoadBody( BuildTable() );
            str.RenderAsHtml( FileName(), persist: true );
        }
        public string RenderData(ArrayList unitList, string sHead, NFLWeek week)
        {
            //  Output the list
            var tu1 = (TeamUnit)unitList[0];
            var r   = new SimpleTableReport {
                ReportHeader = sHead, ReportFooter = "", DoRowNumbers = true
            };
            var ds = LoadData(unitList, week);

            r.AddColumn(new ReportColumn("Name", "TEAM", "{0,-15}"));
            r.AddColumn(new ReportColumn("Rating", "RATING", "{0,-1}"));
            r.AddColumn(new ReportColumn("Total", "tot", "{0,5}"));

            const int startAt = Constants.K_WEEKS_IN_A_SEASON;

            var currentWeek = new NFLWeek(Int32.Parse(Utility.CurrentSeason()), Int32.Parse(Utility.CurrentWeek()), false);

            for (var w = startAt; w > 0; w--)
            {
                var header    = string.Format("Week {0}", currentWeek.Week);
                var fieldName = string.Format(FieldFormat, currentWeek.WeekNo);

                r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", tu1.BGPicker));
                currentWeek = currentWeek.PreviousWeek(currentWeek, true, false);
            }

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = "tot " + tu1.SortDirection();
            r.LoadBody(dt);
            FileOut = string.Format("{0}Units\\{1}.htm", Utility.OutputDirectory(), sHead);
            r.RenderAsHtml(FileOut, true);
            return(FileOut);
        }
        public void GameRatings(NFLWeek week, string fTeamOwner)
        {
            var when = string.Format("Week{0}-{1:0#}", week.Season, Int32.Parse(week.Week));

#if DEBUG
            Utility.Announce(string.Format("   GameRatings for {0} owner {1}", when, fTeamOwner));
#endif
            var str = new SimpleTableReport(string.Format("Game Ratings {1}: {0:0#}", when, Name))
            {
                ColumnHeadings = true, DoRowNumbers = true
            };
            str.AddColumn(new ReportColumn("Rating", "RATING", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Day", "DAY", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Time", "HOUR", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("AT", "AT", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("HT", "HT", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("TV", "TV", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Fav", "FAV", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Spr", "SPREAD", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("myTip", "TIP", "{0}", typeof(String)));

            BuildRatingsTable(str, fTeamOwner, week);

            str.RenderAsHtml(string.Format("{0}Ratings{2}{1}.htm", Utility.OutputDirectory(), when, CompCode), true);
        }
        /// <summary>
        ///   This is a model SimpleTableReport, using expanded ReportColumn constructors
        /// </summary>
        public void RosterReport()
        {
            var week = Int32.Parse(Utility.CurrentWeek());
            var when = string.Format("Week{0}-{1:00}", Season, week);
            var str  = new SimpleTableReport(string.Format("GridStats Roster : {0}", when))
            {
                ColumnHeadings = true,
                DoRowNumbers   = true
            };

            str.AddColumn(new ReportColumn("Team", "FTEAM", "{0,-20}"));
            str.AddColumn(new ReportColumn("Value", "VALUE", "{0}", true));
            str.AddColumn(new ReportColumn("Size", "SIZE", "{0}", true));
            str.AddColumn(new ReportColumn("Avg", "AVG", "{0:#.#}"));
            str.AddColumn(new ReportColumn("Starters", "STARTERS", "{0}", true));
            str.AddColumn(new ReportColumn("Backups", "BACKUPS", "{0}", true));
            str.AddColumn(new ReportColumn("Others", "OTHERS", "{0}", true));
            str.AddColumn(new ReportColumn("Injured", "INJURIES", "{0}", true));
            str.AddColumn(new ReportColumn("TeamBias", "BIAS", "{0,-10}"));

            str.LoadBody(BuildTable());
            FileOut = string.Format("{0}{1}\\RosterSummary\\{2}\\RosterSummary-{3:00}.htm",
                                    Utility.OutputDirectory(), Season, CompCode, week);
            str.RenderAsHtml(FileOut, true);
        }
Example #5
0
        public void Render()
        {
            var str = new SimpleTableReport("Game Summary " + Game.ScoreOut());

            str.AddDenisStyle();
            str.SubHeader  = SubHeading();
            str.AnnounceIt = true;
            str.AddColumn(new ReportColumn("C1", "COL01", "{0}"));
            str.AddColumn(new ReportColumn("C2", "COL02", "{0}"));
            str.AddColumn(new ReportColumn("C3", "COL03", "{0}"));
            str.AddColumn(new ReportColumn("C4", "COL04", "{0}"));
            str.AddColumn(new ReportColumn("C5", "COL05", "{0}"));
            str.AddColumn(new ReportColumn("C6", "COL06", "{0}"));
            str.AddColumn(new ReportColumn("C7", "COL07", "{0}"));
            str.AddColumn(new ReportColumn("C8", "COL08", "{0}"));
            str.AddColumn(new ReportColumn("C9", "COL09", "{0}"));
            str.AddColumn(new ReportColumn("C10", "COL10", "{0}"));
            str.AddColumn(new ReportColumn("C11", "COL11", "{0}"));

            str.CustomHeader = SummaryHeader();

            str.LoadBody(BuildTable());
            GenerateFootNote(str);
            str.RenderAsHtml(FileName(), persist: true);
        }
        /// <summary>
        ///   Creates the output.
        /// </summary>
        public void Render()
        {
            var str = new SimpleTableReport("GameProjection " + Game.GameName());

            str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.AddStyle("label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
            str.AddStyle("value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
            str.AddStyle("#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
            str.AddStyle("div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AnnounceIt      = false;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
            str.AddColumn(new ReportColumn("Rating", "RATING", "{0}"));
            str.AddColumn(new ReportColumn("Score", "SCORE", "{0}"));
            str.AddColumn(new ReportColumn("YDp", "YDP", "{0}", true));
            str.AddColumn(new ReportColumn("Tdp", "TDP", "{0}", true));
            str.AddColumn(new ReportColumn("YDr", "YDR", "{0}", true));
            str.AddColumn(new ReportColumn("Tdr", "TDR", "{0}", true));
            str.AddColumn(new ReportColumn("TDd", "TDD", "{0}", true));
            str.AddColumn(new ReportColumn("TDs", "TDS", "{0}", true));
            str.AddColumn(new ReportColumn("FGs", "FG", "{0}", true));
            str.LoadBody(BuildTable());
            str.SubHeader = SubHeading();
            str.RenderAsHtml(FileName(), true);
        }
Example #7
0
        public string RenderTeams(ICalculate myCalculator)
        {
            Utility.Announce("TeamListing " + Heading);
            var r = new SimpleTableReport(Heading, "")
            {
                DoRowNumbers = true
            };

            var ds = LoadTeams(myCalculator);

            //  define the output
            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Rating", "RATING", "{0,-10}"));
            r.AddColumn(new ReportColumn("F Avg", "FPAVG", "{0,5:###.0}"));
            r.AddColumn(new ReportColumn("F Points", "POINTS", "{0,5}"));
            r.AddColumn(new ReportColumn("Scores", "SCORES", "{0,9}"));
            r.AddColumn(new ReportColumn("Sacks", "SACKS", "{0,5}"));
            r.AddColumn(new ReportColumn("Ints", "INTERCEPTS", "{0,4}"));
            r.AddColumn(new ReportColumn("Avg YDr allwd", "YDRALLOWED", "{0,5}"));
            r.AddColumn(new ReportColumn("Avg YDp allwd", "YDPALLOWED", "{0,5}"));
            r.AddColumn(new ReportColumn("Points allwd", "ALLOWED", "{0,5}"));

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = "FPAVG DESC";
            r.LoadBody(dt);
            FileOut = string.Format("{0}{1}.htm", Utility.OutputDirectory(), Heading);
            r.RenderAsHtml(FileOut, true);
            return(FileOut);
        }
Example #8
0
 /// <summary>
 ///   Creates the output.
 /// </summary>
 public void Render()
 {
     var str = new SimpleTableReport( "Player Profile " + Player.PlayerName );
     str.AddStyle(  "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle(  "#main { margin-left:1em; }" );
     str.AddStyle(  "#dtStamp { font-size:0.8em; }" );
     str.AddStyle(  ".end { clear: both; }" );
     str.AddStyle(  ".gponame { color:white; background:black }" );
     str.AddStyle(  "label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }" );
     str.AddStyle(  "value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }" );
     str.AddStyle(  "#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }" );
     str.AddStyle(  "div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Week",      "WEEK",   "{0}"           ) );
     str.AddColumn( new ReportColumn( "Team",      "TEAM",   "{0}"           ) );
     str.AddColumn( new ReportColumn( "U-Res",     "URES",   "{0}"           ) );
     str.AddColumn( new ReportColumn( "EP",        "EP",     "{0:0.0}", true ) );
     str.AddColumn( new ReportColumn( "Matchup",   "MATCH",  "{0}"           ) );
     str.AddColumn( new ReportColumn( "Stats",     "STATS",  "{0}"           ) );
      str.AddColumn( new ReportColumn( "F Pts",     "FPTS",   "{0}", true ) );
      str.LoadBody( BuildTable() );
     str.SubHeader = SubHeading();
     str.RenderAsHtml( string.Format("{0}players//{1}.htm",
             Utility.OutputDirectory(), Player.PlayerCode), true);
 }
Example #9
0
        public override void RenderAsHtml()
        {
            Name = "Market Analysis " + Season;
            var dt = GetTeams();
            _mTeamList = new ArrayList();
            foreach (var t in from DataRow dr in dt.Rows
                              select dr["TEAMID"].ToString() into teamCode
                              select new NflTeam(teamCode))
            {
                t.CountFaPoints(Season);
                _mTeamList.Add(t);
            }

            //  Use a simple table output to show the rankings
            var str = new SimpleTableReport
                                        {
                                            ReportHeader = Name,
                                            ColumnHeadings = true,
                                            DoRowNumbers = true
                                        };
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
            str.AddColumn(new ReportColumn("FA Points", "FA", "{0,5}"));
            str.AddColumn(new ReportColumn("In", "IN", "{0,5}"));
            str.AddColumn(new ReportColumn("Got", "GOT", "{0}"));
            str.AddColumn(new ReportColumn("Out", "OUT", "{0,5}"));
            str.AddColumn(new ReportColumn("Lost", "LOST", "{0}"));
            str.AddColumn(new ReportColumn("Net", "NET", "{0}"));

            str.LoadBody(BuildTable());

            FileOut = OutputFilename();

            str.RenderAsHtml( FileOut, true);
        }
 /// <summary>
 /// Renders the object as a simple HTML report.
 /// </summary>
 public override void RenderAsHtml()
 {
     Name = "Strength of Schedule";
     var ds = Utility.TflWs.TeamsDs(Season);
     var dt = ds.Tables["Team"];
     _teamList = new ArrayList();
     foreach (DataRow dr in dt.Rows)
     {
         var t = new NflTeam(dr["TEAMID"].ToString(), Season,
                             Int32.Parse(dr["WINS"].ToString()),
                             dr["TEAMNAME"].ToString());
         t.StrengthOfSchedule();
         _teamList.Add(t);
     }
     var str = new SimpleTableReport(Name) {ColumnHeadings = true, DoRowNumbers = true};
     str.AddColumn(new ReportColumn("Team", KFieldTeam, "{0,-20}"));
     str.AddColumn(new ReportColumn("SoS", KFieldSos, "{0}"));
     str.AddColumn(new ReportColumn("Exp W", KFieldExpWins, "{0}"));
     str.AddColumn(new ReportColumn("Exp L", KFieldExpLosses, "{0}"));
     str.AddColumn(new ReportColumn("Prev W", KFieldWins, "{0}"));
     str.AddColumn(new ReportColumn("Prev L", KFieldLosses, "{0}"));
     str.AddColumn(new ReportColumn("Var", KFieldVariance, "{0}"));
     str.LoadBody(BuildTable());
     str.RenderAsHtml( OutputFilename(), true );
 }
Example #11
0
 public void Render()
 {
     var report = string.Format( "Hillen Tips {0}-{1}", Season.Year, Week.Week );
     var str = new SimpleTableReport( report ) { ReportHeader = report };
     StyleHelper.AddStyle( str );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Away", "AWAY", "{0}" ) );
     str.AddColumn( new ReportColumn( "AwayTip", "AWAYTIP", "{0}" ) );
     str.AddColumn( new ReportColumn( "Home", "HOME", "{0}" ) );
     str.AddColumn( new ReportColumn( "HomeTip", "HOMETIP", "{0}" ) );
     str.AddColumn( new ReportColumn( "HLine", "HLINE", "{0}" ) );
     str.AddColumn( new ReportColumn( "Spr", "SPREAD", "{0}" ) );
     str.AddColumn( new ReportColumn( "Result", "RESULT", "{0}" ) );
     str.AddColumn( new ReportColumn( "SuResult", "SURESULT", "{0}" ) );
     str.AddColumn( new ReportColumn( "SuWins", "SUWINS", "{0}" ) );
     str.AddColumn( new ReportColumn( "SuLoses", "SULOSES", "{0}" ) );
     str.AddColumn( new ReportColumn( "SprResult", "SPRRESULT", "{0}" ) );
     str.AddColumn( new ReportColumn( "Wins", "WINS", "{0}" ) );
     str.AddColumn( new ReportColumn( "Loses", "LOSES", "{0}" ) );
     str.AddColumn( new ReportColumn( "Ties", "TIES", "{0}" ) );
     str.LoadBody( BuildTable() );
     //str.SubHeader = SubHeading();
     str.RenderAsHtml( FileName(), true );
 }
Example #12
0
        /// <summary>
        ///   Creates the output.
        /// </summary>
        public void Render()
        {
            var homeRatings = Game.HomeNflTeam.Ratings;
            var awayRatings = Game.AwayNflTeam.Ratings;

            Game.LoadPrediction();              // ratings get overwritten!!

            Game.HomeNflTeam.Ratings = homeRatings;
            Game.AwayNflTeam.Ratings = awayRatings;

            var str = new SimpleTableReport("GameProjection " + Game.GameName());

            str.AddDenisStyle();
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AnnounceIt      = AnnounceIt;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
            str.AddColumn(new ReportColumn("Rating", "RATING", "{0}"));
            str.AddColumn(new ReportColumn("Score", "SCORE", "{0}", ScoreTotalDelegate));
            str.AddColumn(new ReportColumn("YDp", "YDP", "{0}", true));
            str.AddColumn(new ReportColumn("Tdp", "TDP", "{0}", true));
            str.AddColumn(new ReportColumn("YDr", "YDR", "{0}", true));
            str.AddColumn(new ReportColumn("Tdr", "TDR", "{0}", true));
            str.AddColumn(new ReportColumn("TDd", "TDD", "{0}", true));
            str.AddColumn(new ReportColumn("TDs", "TDS", "{0}", true));
            str.AddColumn(new ReportColumn("FGs", "FG", "{0}", true));
            str.LoadBody(BuildTable());
            str.SubHeader = SubHeading();
            str.FootNote  = Game.PlayerProjectionsHtml();             //  these projections are old
            str.RenderAsHtml(FileName(), true);
        }
Example #13
0
 /// <summary>
 /// Renders the object as a simple HTML report.
 /// </summary>
 public void Render()
 {
     MetricsBase = new MetricsBase(new PreStyleBreakdown(), Season) { DoBreakdowns = true };
      MetricsBase.Load(Season, skipPostseason:true);
      TeamList = MetricsBase.TeamList;
     var str = new SimpleTableReport( string.Format( "Balance Report {0}", Season ) );
     str.AddStyle(  "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle(  "#main { margin-left:1em; }" );
     str.AddStyle(  "#dtStamp { font-size:0.8em; }" );
     str.AddStyle(  ".end { clear: both; }" );
     str.AddStyle(  ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Team",      "TEAM",   "{0}", typeof( String )       ) );
     str.AddColumn( new ReportColumn( "Rating",    "RATING", "{0}", typeof( String )       ) );
     str.AddColumn( new ReportColumn( "Plays",     "PLAYS",  "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Passes",    "PASSES", "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Runs",      "RUNS",   "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Pass%",     "PPERCENT",  "{0:0.00}", typeof( decimal ), false ) );
     str.AddColumn( new ReportColumn( "Run%",      "RPERCENT",  "{0:0.00}", typeof( decimal ), false ) );
     str.AddColumn( new ReportColumn( "Tdp", "TDPASSES", "{0}", typeof( string ) ) );
     str.AddColumn( new ReportColumn( "Tdr", "TDRUNS", "{0}",   typeof( String ) ) );
     BuildTable( str );
     str.SetSortOrder( "PASSES DESC");
     str.RenderAsHtml( OutputFilename(), true );
 }
Example #14
0
        public void Render()
        {
            var str = new SimpleTableReport("Tipping Report " + m_Season);

            str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.AddStyle("label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
            str.AddStyle("value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
            str.AddStyle("#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
            str.AddStyle("div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Wk", "WEEK", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("G", "GAMES", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Spr", "SPREAD", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("MyT", "MYTIPS", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("ATS", "ATS", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("H", "HOME", "{0}", typeof(Int32), true));
            BuildTable(str);
            str.RenderAsHtml(string.Format("{0}//tipping{1}.htm", Utility.OutputDirectory(), m_Season), true);
        }
Example #15
0
        public void Render(string header)
        {
            //  Output the list
            Heading = header;
            Utility.Announce("TeamListing " + Heading);
            var r = new SimpleTableReport(Heading, "")
            {
                DoRowNumbers = true
            };

            if (!string.IsNullOrEmpty(SubHeading))
            {
                r.SubHeader = SubHeading;
            }

            var ds = LoadData();

            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Sacks", "SACKS", "{0,9}"));
            r.AddColumn(new ReportColumn("Interceptions", "INTERCEPTS", "{0,4}"));
            r.AddColumn(new ReportColumn("Points", "POINTS", "{0,5}"));
            var dt = ds.Tables[0];

            dt.DefaultView.Sort = "Points DESC";
            r.LoadBody(dt);
            FileOut = string.Format("{0}{1}.htm", Utility.OutputDirectory(), Heading);
            r.RenderAsHtml(FileOut, true);
        }
Example #16
0
 public void Render()
 {
     SimpleTableReport str = new SimpleTableReport( "Volume Report " + m_Season );
      str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
      str.AddStyle("#main { margin-left:1em; }");
      str.AddStyle("#dtStamp { font-size:0.8em; }");
      str.AddStyle(".end { clear: both; }");
      str.AddStyle(".gponame { color:white; background:black }");
      str.AddStyle("label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
      str.AddStyle("value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
      str.AddStyle("#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
      str.AddStyle("div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
      str.ColumnHeadings = true;
      str.DoRowNumbers = false;
      str.ShowElapsedTime = false;
      str.IsFooter = false;
      str.AddColumn(new ReportColumn("Wk", "WEEK", "{0}", typeof(String) ));
      str.AddColumn(new ReportColumn("G", "GAMES", "{0}", typeof(Int32), true ));
      str.AddColumn(new ReportColumn("Spr", "SPREAD", "{0}", typeof(Int32), true ));
      str.AddColumn(new ReportColumn("MyT", "MYTIPS", "{0}", typeof(Int32), true ));
      str.AddColumn(new ReportColumn("ATS", "ATS", "{0}", typeof(Int32), true));
      str.AddColumn(new ReportColumn("H", "HOME", "{0}", typeof(Int32), true));
      BuildTable(str);
      str.RenderAsHtml(string.Format("{0}//tipping{1}.htm", Utility.OutputDirectory(), m_Season), true);
 }
Example #17
0
        public void RenderTeam(NflTeam team)
        {
            if (team.MetricsHt == null)
            {
                LoadTeam(team, team.TeamCode);
            }
            var metricsHt = team.MetricsHt;
            var str       = new SimpleTableReport(string.Format("Metrics-{0}", team.TeamCode));

            str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 761px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Week", "WeekSeed", "{0}", typeof(String), false));
            str.AddColumn(new ReportColumn("OffTDp", "OffTDp", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Mult", "AvgOffTDp", "{0:#.#}", typeof(Decimal), false));
            str.AddColumn(new ReportColumn("OffTDr", "OFFTDR", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Mult", "AvgOffTDr", "{0:#.#}", typeof(Decimal), false));
            str.AddColumn(new ReportColumn("OffSAKa", "OFFSAKa", "{0}", typeof(Decimal), true));
            str.AddColumn(new ReportColumn("Mult", "AvgOffSaka", "{0:#.#}", typeof(Decimal), false));
            str.AddColumn(new ReportColumn("DefTDpa", "DefTDpa", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Mult", "AvgDefTDp", "{0:#.#}", typeof(Decimal), false));
            str.AddColumn(new ReportColumn("DefTDra", "DEFTDRa", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Mult", "AvgDefTDr", "{0:#.#}", typeof(Decimal), false));
            str.AddColumn(new ReportColumn("DefSAK", "DEFSAK", "{0}", typeof(Decimal), true));
            str.AddColumn(new ReportColumn("Mult", "AvgDefSak", "{0:#.#}", typeof(Decimal), false));
            BuildTable(str, metricsHt, team);
            str.SetSortOrder("WeekSeed");
            str.RenderAsHtml(string.Format("{0}Metrics-{1}.htm", Utility.OutputDirectory(), team.TeamCode), true);
        }
Example #18
0
        public void Render()
        {
            var str = new SimpleTableReport(string.Format("Score Grid {0}-{1}", Season.Year, ScopeInFocus))
            {
                ReportHeader = ScopeInFocus
            };

            StyleHelper.AddStyle(str);
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Stat", "STAT", "{0}"));
            str.AddColumn(new ReportColumn("Total", "TOT", "{0}"));
            str.AddColumn(new ReportColumn("Wk01", "WK01", "{0}"));
            str.AddColumn(new ReportColumn("Wk02", "WK02", "{0}"));
            str.AddColumn(new ReportColumn("Wk03", "WK03", "{0}"));
            str.AddColumn(new ReportColumn("Wk04", "WK04", "{0}"));
            str.AddColumn(new ReportColumn("Wk05", "WK05", "{0}"));
            str.AddColumn(new ReportColumn("Wk06", "WK06", "{0}"));
            str.AddColumn(new ReportColumn("Wk07", "WK07", "{0}"));
            str.AddColumn(new ReportColumn("Wk08", "WK08", "{0}"));
            str.AddColumn(new ReportColumn("Wk09", "WK09", "{0}"));
            str.AddColumn(new ReportColumn("Wk10", "WK10", "{0}"));
            str.AddColumn(new ReportColumn("Wk11", "WK11", "{0}"));
            str.AddColumn(new ReportColumn("Wk12", "WK12", "{0}"));
            str.AddColumn(new ReportColumn("Wk13", "WK13", "{0}"));
            str.AddColumn(new ReportColumn("Wk14", "WK14", "{0}"));
            str.AddColumn(new ReportColumn("Wk15", "WK15", "{0}"));
            str.AddColumn(new ReportColumn("Wk16", "WK16", "{0}"));
            str.AddColumn(new ReportColumn("Wk17", "WK17", "{0}"));
            str.LoadBody(BuildTable());
            //str.SubHeader = SubHeading();
            str.RenderAsHtml(FileName(), true);
        }
Example #19
0
        public void Render()
        {
            var str = new SimpleTableReport(string.Format("FP Projection {0}-{1}", Season, Week))
            {
                ReportHeader = string.Format("Run Date: {0: dddd dd MMM yyyy}", DateTime.Now)
            };

            StyleHelper.AddStyle(str);
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Player", "PLAYER", "{0}"));
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
            str.AddColumn(new ReportColumn("Owner", "FTEAM", "{0}"));
            str.AddColumn(new ReportColumn("Pos", "POS", "{0}"));
            str.AddColumn(new ReportColumn("FPoints", "PTS", "{0}"));
            str.AddColumn(new ReportColumn("Unit", "UNIT", "{0}"));
            str.AddColumn(new ReportColumn("Role", "ROLE", "{0}"));
            str.AddColumn(new ReportColumn("Game", "GAME", "{0}"));
            str.AddColumn(new ReportColumn("OppUnit", "OPPRATE", "{0}"));
            str.AddColumn(new ReportColumn("Spread", "SPREAD", "{0:##.#}"));
            str.AddColumn(new ReportColumn("Total", "TOTAL", "{0:##.#}"));
            str.AddColumn(new ReportColumn("Bookie", "BOOKIE", "{0}"));
            str.AddColumn(new ReportColumn("Actual", "ACTUAL", "{0:##}"));
            str.LoadBody(BuildTable());
            var fileOut = FileName();

            str.RenderAsHtml(fileOut, true);
        }
Example #20
0
        private void DumpMetricTable(
            DataTable dt,
            DateTime when,
            string sortColumn = "YDr")
        {
            var st =
                new SimpleTableReport(
                    $@"Team Metrics at {
						when.ToShortDateString()
						} {GameScope}"                        )
            {
                ColumnHeadings = true
            };

            st.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
            st.AddColumn(new ReportColumn("YDp/A", "YDp", "{0:0.00}"));
            st.AddColumn(new ReportColumn("RYDp", "RYDp", "{0}"));
            st.AddColumn(new ReportColumn("YDr", "YDr", "{0}"));
            st.AddColumn(new ReportColumn("RYDr", "RYDr", "{0}"));
            st.AddColumn(new ReportColumn("SAKa", "SAKa", "{0}"));
            st.AddColumn(new ReportColumn("RSAKa", "RSAKa", "{0}"));
            st.AddColumn(new ReportColumn("SAK", "SAK", "{0}"));
            st.AddColumn(new ReportColumn("RSAK", "RSAK", "{0}"));
            st.AddColumn(new ReportColumn("YDra", "YDra", "{0}"));
            st.AddColumn(new ReportColumn("RYDra", "RYDra", "{0}"));
            st.AddColumn(new ReportColumn("INT", "INT", "{0}"));
            st.AddColumn(new ReportColumn("TDpa", "TDpa", "{0}"));
            st.AddColumn(new ReportColumn("IntRatio", "IntRatio", "{0}"));
            st.AddColumn(new ReportColumn("RIntRatio", "RIntRatio", "{0}"));
            st.AddColumn(new ReportColumn("RPoints", "RPTS", "{0}"));
            dt.DefaultView.Sort = $"{sortColumn} DESC";
            st.LoadBody(dt);
            st.RenderAsHtml(FileOut, true);
        }
Example #21
0
        /// <summary>
        ///   Creates the output.
        /// </summary>
        public void Render()
        {
            var homeRatings = Game.HomeNflTeam.Ratings;
            var awayRatings = Game.AwayNflTeam.Ratings;

             Game.LoadPrediction();  // ratings get overwritten!!

              Game.HomeNflTeam.Ratings = homeRatings;
            Game.AwayNflTeam.Ratings = awayRatings;

             var str = new SimpleTableReport( "GameProjection " + Game.GameName() );
             str.AddDenisStyle();
             str.ColumnHeadings = true;
             str.DoRowNumbers = false;
             str.ShowElapsedTime = false;
             str.IsFooter = false;
             str.AnnounceIt = AnnounceIt;
             str.AddColumn( new ReportColumn( "Team",      "TEAM",   "{0}"           ) );
             str.AddColumn( new ReportColumn( "Rating",    "RATING", "{0}"           ) );
             str.AddColumn( new ReportColumn( "Score",     "SCORE",  "{0}", ScoreTotalDelegate           ) );
             str.AddColumn( new ReportColumn( "YDp",       "YDP",    "{0}", true ) );
             str.AddColumn( new ReportColumn( "Tdp",       "TDP",    "{0}", true ) );
             str.AddColumn( new ReportColumn( "YDr",       "YDR",    "{0}", true ) );
             str.AddColumn( new ReportColumn( "Tdr",       "TDR",    "{0}", true     ) );
             str.AddColumn( new ReportColumn( "TDd",       "TDD",    "{0}", true     ) );
             str.AddColumn( new ReportColumn( "TDs",       "TDS",    "{0}", true     ) );
             str.AddColumn( new ReportColumn( "FGs",       "FG",     "{0}", true     ) );
             str.LoadBody( BuildTable() );
             str.SubHeader = SubHeading();
             str.FootNote = Game.PlayerProjectionsHtml();  //  these projections are old
             str.RenderAsHtml( FileName(), true );
        }
        /// <summary>
        ///   Looks at the EP xml to dump out a report
        /// </summary>
        public void RosterExperience()
        {
            Utility.Announce("NFLRosterReport.RosterExperience - creating simple report");

            CheckPreRequisites();

            var str =
                new SimpleTableReport(string.Format("Roster Experience {0}", Utility.CurrentSeason()));

            str.AddStyle(
                "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Player", "PLAYER", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Unit", "UNIT", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("EP", "EP", "{0}", typeof(Int32), true));
            BuildTable(str);
            str.SetSortOrder("EP DESC");
            str.RenderAsHtml(
                string.Format("{0}Experience-{1}-{2}.htm", Utility.OutputDirectory(), Utility.CurrentSeason(),
                              Utility.CurrentWeek()), true);
        }
Example #23
0
        public string RenderTeamToBeat(ICalculate myCalculator)
        {
#if DEBUG
            Utility.Announce("RenderTeamToBeat " + Heading);
#endif
            var r = new SimpleTableReport(Heading, "")
            {
                DoRowNumbers = true
            };
            //  Crunch the numbers
            var ds = LoadTeamToBeat(myCalculator);
            //  define the output
            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Off Rating", "RATING", "{0,-10}"));
            r.AddColumn(new ReportColumn("Opponent", "OPP", "{0,-10}"));
            r.AddColumn(new ReportColumn("FP allwd", "POINTS", "{0,5}"));
            r.AddColumn(new ReportColumn("FP Avg allwd", "FPAVG", "{0,5:###.0}"));
            r.AddColumn(new ReportColumn("Scores allwd", "SCORES", "{0,9}"));
            r.AddColumn(new ReportColumn("Sacks allwd", "SACKS", "{0,5}"));
            r.AddColumn(new ReportColumn("Ints allwd", "INTERCEPTS", "{0,4}"));
            r.AddColumn(new ReportColumn("Avg Pts Scored", "ALLOWED", "{0,5}"));

            var dt = ds.Tables[0];
            dt.DefaultView.Sort = "FPAVG DESC";
            r.LoadBody(dt);
            FileOut = string.Format("{0}{1}.htm", Utility.OutputDirectory(), Heading);
            r.RenderAsHtml(FileOut, true);
            return(FileOut);
        }
        /// <summary>
        ///   Creates the output.
        /// </summary>
        public void Render()
        {
            var str = new SimpleTableReport("Player Projection " + Player.PlayerName + "-" + Season);

            str.AddStyle(
                "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.AddStyle(
                "label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
            str.AddStyle(
                "value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
            str.AddStyle(
                "#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
            str.AddStyle(
                "div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Week", "WEEK", "{0}"));
            str.AddColumn(new ReportColumn("Matchup", "MATCH", "{0}"));
            str.AddColumn(new ReportColumn("Score", "SCORE", "{0}"));
            str.AddColumn(new ReportColumn("OppUnit", "OPPRATE", "{0}"));
            str.AddColumn(new ReportColumn("Projection", "PROJ", "{0:0.0}", true));
            str.AddColumn(new ReportColumn("Y-FP", "FP", "{0:0.0}", true));
            str.AddColumn(new ReportColumn("Stats", "STATS", "{0}"));
            str.AddColumn(new ReportColumn("Actual", "ACTUAL", "{0:0.0}", true));
            str.AddColumn(new ReportColumn("Variation", "VAR", "{0:0.0}"));
            str.LoadBody(BuildTable());
            str.SubHeader = SubHeading();
            str.RenderAsHtml(FileName(), true);
        }
Example #25
0
        /// <summary>
        /// Renders the object as a simple HTML report.
        /// </summary>
        public override void RenderAsHtml()
        {
            Name = "Strength of Schedule";
            var ds = Utility.TflWs.TeamsDs(Season);
            var dt = ds.Tables["Team"];

            _teamList = new ArrayList();
            foreach (DataRow dr in dt.Rows)
            {
                var t = new NflTeam(dr["TEAMID"].ToString(), Season,
                                    Int32.Parse(dr["WINS"].ToString()),
                                    dr["TEAMNAME"].ToString());
                t.StrengthOfSchedule();
                _teamList.Add(t);
            }
            var str = new SimpleTableReport(Name)
            {
                ColumnHeadings = true, DoRowNumbers = true
            };

            str.AddColumn(new ReportColumn("Team", KFieldTeam, "{0,-20}"));
            str.AddColumn(new ReportColumn("SoS", KFieldSos, "{0}"));
            str.AddColumn(new ReportColumn("Exp W", KFieldExpWins, "{0}"));
            str.AddColumn(new ReportColumn("Exp L", KFieldExpLosses, "{0}"));
            str.AddColumn(new ReportColumn("Prev W", KFieldWins, "{0}"));
            str.AddColumn(new ReportColumn("Prev L", KFieldLosses, "{0}"));
            str.AddColumn(new ReportColumn("Var", KFieldVariance, "{0}"));
            str.LoadBody(BuildTable());
            str.RenderAsHtml(OutputFilename(), true);
        }
Example #26
0
        /// <summary>
        ///   Creates the output.
        /// </summary>
        public void Render()
        {
            var str = new SimpleTableReport("Player Profile " + Player.PlayerName);

            str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.AddStyle("label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
            str.AddStyle("value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
            str.AddStyle("#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
            str.AddStyle("div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Week", "WEEK", "{0}"));
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
            str.AddColumn(new ReportColumn("U-Res", "URES", "{0}"));
            str.AddColumn(new ReportColumn("EP", "EP", "{0:0.0}", true));
            str.AddColumn(new ReportColumn("Matchup", "MATCH", "{0}"));
            str.AddColumn(new ReportColumn("Stats", "STATS", "{0}"));
            str.LoadBody(BuildTable());
            str.SubHeader = SubHeading();
            str.RenderAsHtml(string.Format("{0}players//{1}.htm",
                                           Utility.OutputDirectory(), Player.PlayerCode), true);
        }
Example #27
0
        public void Render()
        {
            var report = string.Format("Hillen Tips {0}-{1}", Season.Year, Week.Week);
            var str    = new SimpleTableReport(report)
            {
                ReportHeader = report
            };

            StyleHelper.AddStyle(str);
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Away", "AWAY", "{0}"));
            str.AddColumn(new ReportColumn("AwayTip", "AWAYTIP", "{0}"));
            str.AddColumn(new ReportColumn("Home", "HOME", "{0}"));
            str.AddColumn(new ReportColumn("HomeTip", "HOMETIP", "{0}"));
            str.AddColumn(new ReportColumn("HLine", "HLINE", "{0}"));
            str.AddColumn(new ReportColumn("Spr", "SPREAD", "{0}"));
            str.AddColumn(new ReportColumn("Result", "RESULT", "{0}"));
            str.AddColumn(new ReportColumn("SuResult", "SURESULT", "{0}"));
            str.AddColumn(new ReportColumn("SuWins", "SUWINS", "{0}"));
            str.AddColumn(new ReportColumn("SuLoses", "SULOSES", "{0}"));
            str.AddColumn(new ReportColumn("SprResult", "SPRRESULT", "{0}"));
            str.AddColumn(new ReportColumn("Wins", "WINS", "{0}"));
            str.AddColumn(new ReportColumn("Loses", "LOSES", "{0}"));
            str.AddColumn(new ReportColumn("Ties", "TIES", "{0}"));
            str.LoadBody(BuildTable());
            //str.SubHeader = SubHeading();
            str.RenderAsHtml(FileName(), true);
        }
        private static void DumpMetricTable(DataTable dt, DateTime when)
        {
            var st =
                new SimpleTableReport(string.Format("Team Metrics at {0}", when.ToShortDateString())
                                      )
            {
                ColumnHeadings = true
            };

            st.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
            st.AddColumn(new ReportColumn("YDp", "YDp", "{0}"));
            st.AddColumn(new ReportColumn("RYDp", "RYDp", "{0}"));
            st.AddColumn(new ReportColumn("YDr", "YDr", "{0}"));
            st.AddColumn(new ReportColumn("RYDr", "RYDr", "{0}"));
            st.AddColumn(new ReportColumn("SAKa", "SAKa", "{0}"));
            st.AddColumn(new ReportColumn("RSAKa", "RSAKa", "{0}"));
            st.AddColumn(new ReportColumn("SAK", "SAK", "{0}"));
            st.AddColumn(new ReportColumn("RSAK", "RSAK", "{0}"));
            st.AddColumn(new ReportColumn("YDra", "YDra", "{0}"));
            st.AddColumn(new ReportColumn("RYDra", "RYDra", "{0}"));
            st.AddColumn(new ReportColumn("INT", "INT", "{0}"));
            st.AddColumn(new ReportColumn("TDpa", "TDpa", "{0}"));
            st.AddColumn(new ReportColumn("IntRatio", "IntRatio", "{0}"));
            st.AddColumn(new ReportColumn("RIntRatio", "RIntRatio", "{0}"));
            st.AddColumn(new ReportColumn("RPoints", "RPTS", "{0}"));
            dt.DefaultView.Sort = "YDr DESC";
            st.LoadBody(dt);
            st.RenderAsHtml(string.Format("{0}\\{1}\\Metrics\\MetricTable.htm",
                                          Utility.OutputDirectory(), Utility.CurrentSeason()), true);
        }
Example #29
0
        /// <summary>
        /// Renders the object as a simple HTML report.
        /// </summary>
        public void Render()
        {
            MetricsBase = new MetricsBase(new PreStyleBreakdown(), Season)
            {
                DoBreakdowns = true
            };
            MetricsBase.Load(Season, skipPostseason: true);
            TeamList = MetricsBase.TeamList;
            var str = new SimpleTableReport(string.Format("Balance Report {0}", Season));

            str.AddStyle("#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = true;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Rating", "RATING", "{0}", typeof(String)));
            str.AddColumn(new ReportColumn("Plays", "PLAYS", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Passes", "PASSES", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Runs", "RUNS", "{0}", typeof(Int32), true));
            str.AddColumn(new ReportColumn("Pass%", "PPERCENT", "{0:0.00}", typeof(decimal), false));
            str.AddColumn(new ReportColumn("Run%", "RPERCENT", "{0:0.00}", typeof(decimal), false));
            str.AddColumn(new ReportColumn("Tdp", "TDPASSES", "{0}", typeof(string)));
            str.AddColumn(new ReportColumn("Tdr", "TDRUNS", "{0}", typeof(String)));
            BuildTable(str);
            str.SetSortOrder("PASSES DESC");
            str.RenderAsHtml(OutputFilename(), true);
        }
        public string RenderData(ArrayList playerList, string sHead, NFLWeek week)
        {
            //  Output the list
            var r = new SimpleTableReport {
                ReportHeader = sHead, ReportFooter = "", DoRowNumbers = true
            };

            var ds = LoadData(playerList, week);

            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Team", "CURRTEAM", "{0,2}"));
            r.AddColumn(new ReportColumn("Role", "ROLE", "{0,1}"));
            r.AddColumn(new ReportColumn("Owner", "FT", "{0,2}"));
            r.AddColumn(new ReportColumn("Total", "tot", "{0,5}"));

            var startAt = FullStart ? Constants.K_WEEKS_IN_A_SEASON : Constants.K_WEEKS_IN_REGULAR_SEASON;

//			var currentWeek = new NFLWeek( Int32.Parse( Utility.CurrentSeason()), Int32.Parse( Utility.CurrentWeek() ), false );

            for (var w = startAt; w > 0; w--)
            {
                var header    = string.Format("Week {0}", w);
                var fieldName = string.Format(FieldFormat, w);

                if (IsGridStatsQBReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", QbBgPicker));
                }
                if (IsYahooQbReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnQbBgPicker));
                }
                if (IsYahooRbReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnRbBgPicker));
                }
                if (IsYahooWrReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnWrBgPicker));
                }
                if (IsYahooTeReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnTeBgPicker));
                }
                if (IsYahooPkReport(sHead))
                {
                    r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnPkBgPicker));
                }
            }

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = "tot DESC";
            r.LoadBody(dt);
            FileOut = sHead;
            r.RenderAsHtml(FileOut, true);
            return(FileOut);
        }
Example #31
0
        public string RenderData(ArrayList playerList, string sHead, [Optional] string sortOrder, IRatePlayers scorer)
        {
            //  Output the list
            Utility.Announce("PlayerListing " + sHead);
            var r = new SimpleTableReport {
                ReportHeader = sHead, DoRowNumbers = true
            };

            if (!string.IsNullOrEmpty(SubHeader))
            {
                r.SubHeader = SubHeader;
            }
            ////////////////////////////////////////////
            var ds = LoadData(playerList, scorer);                  //  <--action

            ////////////////////////////////////////////
            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Pos", "POS", "{0,9}"));
            r.AddColumn(new ReportColumn("Role", "ROLE", "{0,9}"));
            r.AddColumn(new ReportColumn("RookieYr", "ROOKIEYR", "{0,4}"));
            r.AddColumn(new ReportColumn("Team", "CURRTEAM", "{0,2}"));
            r.AddColumn(new ReportColumn("Age", "AGE", "{0,2}"));
            r.AddColumn(new ReportColumn("Owner", "FT", "{0,2}"));
            if (LongStats)
            {
                r.AddColumn(new ReportColumn("Curr", "CURSCORES", "{0,5}"));
                r.AddColumn(new ReportColumn("Tot", "SCORES", "{0,5}"));
                r.AddColumn(new ReportColumn("Avg", "AVG", "{0:0.0}"));
                r.AddColumn(new ReportColumn("Inj", "INJURY", "{0,5}"));
                r.AddColumn(new ReportColumn("YDp", "YDP", "{0,5}"));
                r.AddColumn(new ReportColumn("Tdp", "TDP", "{0,5}"));
                r.AddColumn(new ReportColumn("YDr", "YDR", "{0,5}"));
                r.AddColumn(new ReportColumn("Tdr", "TDR", "{0,5}"));
                r.AddColumn(new ReportColumn("YDc", "YDC", "{0,5}"));
                r.AddColumn(new ReportColumn("TDc", "TDC", "{0,5}"));
                r.AddColumn(new ReportColumn("Fg", "Fg", "{0,5}"));
            }
            r.AddColumn(new ReportColumn("Points", "POINTS", "{0,5}"));

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = LongStats
                           ? (string.IsNullOrEmpty(sortOrder) ? "Points DESC" : sortOrder) : "Points DESC";

            r.LoadBody(dt);               //  just assigns the data table
            if (string.IsNullOrEmpty(FileOut))
            {
                FileOut = string.Format("{0}{2}//{1}.htm",
                                        Utility.OutputDirectory(), sHead, Utility.CurrentSeason());
            }
            r.RenderAsHtml(FileOut, true);

            if (RenderToCsv)
            {
                r.RenderAsCsv("Starters-" + sHead, Logger);
            }
            return(FileOut);
        }
Example #32
0
        /// <summary>
        /// Renders the object as a simple HTML report.
        /// </summary>
        public void RenderAsHtml()
        {
            FileOut = string.Format("{2}{0}//victory//vp-{1:0#}.htm", _season, Int32.Parse(Utility.CurrentWeek()),
                                    Utility.OutputDirectory());
            var str = new SimpleTableReport("Victory Points : Week " + Utility.CurrentWeek())
            {
                ColumnHeadings = true, DoRowNumbers = true
            };

            str.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
            str.AddColumn(new ReportColumn("VP", "VP", "{0}"));
            str.LoadBody(BuildTable());
            str.RenderAsHtml(FileOut, true);
        }
Example #33
0
        /// <summary>
        ///   Zoom in at the player level
        /// </summary>
        public void DumpTeam()
        {
            var teamdump = new SimpleTableReport(string.Format("Team: {0}", Name))
            {
                ColumnHeadings = true, DoRowNumbers = true
            };

            teamdump.AddColumn(new ReportColumn("Player", "PLAYER", "{0,20}", BgPicker));
            teamdump.AddColumn(new ReportColumn("Pos", "POS", "{0}"));
            teamdump.AddColumn(new ReportColumn("Role", "ROLE", "{0}"));
            teamdump.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
            teamdump.AddColumn(new ReportColumn("Seasons", "SEASONS", "{0}"));
            teamdump.AddColumn(new ReportColumn("ScoreAvg", "SCORES", "{0:0.0}", true));
            teamdump.LoadBody(BuildTable());
            teamdump.RenderAsHtml(DumpFileName(), true);
        }
Example #34
0
        public void Render()
        {
            var str = new SimpleTableReport(string.Format("Projected Lineup {0}:{1:#0} {2}", Season, Week, LeagueId));

            str.AddStyle(
                "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.ColumnHeadings  = true;
            str.DoRowNumbers    = false;
            str.ShowElapsedTime = false;
            str.IsFooter        = false;
            str.AddColumn(new ReportColumn("Week", "WEEK", "{0}"));
            if (LeagueId.Equals(Constants.K_LEAGUE_Gridstats_NFL1))
            {
                str.AddColumn(new ReportColumn("Q1", "Q1", "{0}"));
                str.AddColumn(new ReportColumn("R1", "R1", "{0}"));
                str.AddColumn(new ReportColumn("R2", "R2", "{0}"));
                str.AddColumn(new ReportColumn("T1", "T1", "{0}"));
                str.AddColumn(new ReportColumn("W1", "W1", "{0}"));
                str.AddColumn(new ReportColumn("W2", "W2", "{0}"));
                str.AddColumn(new ReportColumn("K1", "K1", "{0}"));
                str.AddColumn(new ReportColumn("Q2", "Q2", "{0}"));
                str.AddColumn(new ReportColumn("R4", "R4", "{0}"));
                str.AddColumn(new ReportColumn("R3", "R3", "{0}"));
                str.AddColumn(new ReportColumn("T2", "T2", "{0}"));
                str.AddColumn(new ReportColumn("W4", "W4", "{0}"));
                str.AddColumn(new ReportColumn("W3", "W3", "{0}"));
                str.AddColumn(new ReportColumn("K2", "K2", "{0}"));
            }
            else
            {
                str.AddColumn(new ReportColumn("QB", "QB", "{0}"));
                str.AddColumn(new ReportColumn("RB1", "RB1", "{0}"));
                str.AddColumn(new ReportColumn("RB2", "RB2", "{0}"));
                str.AddColumn(new ReportColumn("WR1", "WR1", "{0}"));
                str.AddColumn(new ReportColumn("WR2", "WR2", "{0}"));
                str.AddColumn(new ReportColumn("WR3", "WR3", "{0}"));
                str.AddColumn(new ReportColumn("TE", "TE", "{0}"));
                str.AddColumn(new ReportColumn("PK", "PK", "{0}"));
            }

            str.LoadBody(BuildTable());
            str.RenderAsHtml(FileName(), true);
        }
        /// <summary>
        /// Renders the object as a simple HTML report.
        /// </summary>
        public void RenderAsHtml()
        {
            var str = new SimpleTableReport("Strength of Schedule")
            {
                ColumnHeadings = true, DoRowNumbers = true
            };

            str.AddColumn(new ReportColumn("Team", KFieldTeam, "{0,-20}"));
            str.AddColumn(new ReportColumn("SoS", KFieldSos, "{0}"));
            str.AddColumn(new ReportColumn("Exp W", KFieldExpWins, "{0}"));
            str.AddColumn(new ReportColumn("Exp L", KFieldExpLosses, "{0}"));
            str.AddColumn(new ReportColumn("Prev W", KFieldWins, "{0}"));
            str.AddColumn(new ReportColumn("Prev L", KFieldLosses, "{0}"));
            str.AddColumn(new ReportColumn("Var", KFieldVariance, "{0}"));
            str.LoadBody(BuildTable());
            str.RenderAsHtml(string.Format("{0}\\{1}\\StrengthOfSchedule.htm", Utility.OutputDirectory(), _season), true);
        }
Example #36
0
        public string RenderProjectedData(
            ArrayList playerList,
            string sHead,
            [Optional] string sortOrder,
            IRatePlayers scorer,
            IWeekMaster weekMaster,
            IAdpMaster adpMaster = null)
        {
            //  Output the list
            Utility.Announce("PlayerListing " + sHead);

            SimpleTableReport r = SetUpProjectionReport(
                sHead);

            var ds = LoadProjectedData(
                plyrList: playerList,
                scorer: scorer,
                weekMaster: weekMaster,
                adpMaster: adpMaster);

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = LongStats
                           ? (string.IsNullOrEmpty(sortOrder)
                           ? "Points DESC" : sortOrder) : "Points DESC";

            r.LoadBody(dt);             //  just assigns the data table
            FileOut = $@"{
				Utility.OutputDirectory()
				}//{
				Season
				}//Projections//{
				sHead
				}.htm"                ;
            r.RenderAsHtml(
                fileName: FileOut,
                persist: true);

            if (RenderToCsv)
            {
                r.RenderAsCsv(
                    "Starters-" + sHead,
                    Logger);
            }
            return(FileOut);
        }
Example #37
0
        private void Render()
        {
            SimpleTableReport str = new SimpleTableReport( "Gordan Rankings : Week " + Utility.CurrentWeek() );
             str.ColumnHeadings = true;
             str.DoRowNumbers = true;
             str.AddColumn( new ReportColumn( "Team", "TEAM", "{0,-20}" ) );
             str.AddColumn( new ReportColumn( "Rating", "RANK", "{0}" ) );
             for ( int i = Int32.Parse( Utility.CurrentWeek() ); i > -1; i-- )
             {
            string colName = string.Format( "Week{0:0#}", i );
            str.AddColumn( new ReportColumn( colName, colName, "{0}" ) );
             }

             str.LoadBody( dt );
             str.RenderAsHtml(
            string.Format("{0}Gordan{1}{2}.htm", Utility.OutputDirectory(), s.Year, Utility.CurrentWeek()),
            true );
        }
Example #38
0
        private void DumpResults(DataTable dt)
        {
            var st =
                new SimpleTableReport("Back Testing Results " + Week + ":" + Season)
            {
                ColumnHeadings = true
            };

            st.AddColumn(new ReportColumn("Scheme", "Name", "{0,-20}"));
            st.AddColumn(new ReportColumn("Wagers", "Bets", "{0}"));
            st.AddColumn(new ReportColumn("M_wins", "M_wins", "{0}"));
            st.AddColumn(new ReportColumn("Losses", "Losses", "{0}"));
            st.AddColumn(new ReportColumn("Pushes", "Pushes", "{0}"));
            st.AddColumn(new ReportColumn("Clip", "Clip", "{0:0.000}"));
            st.LoadBody(dt);
            st.RenderAsHtml(string.Format("{0}Back Testing Results {1} {2}.htm",
                                          Utility.OutputDirectory(), Week, Utility.CurrentSeason()), true);
        }
Example #39
0
        private void Render()
        {
            SimpleTableReport str = new SimpleTableReport("Gordan Rankings : Week " + Utility.CurrentWeek());

            str.ColumnHeadings = true;
            str.DoRowNumbers   = true;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
            str.AddColumn(new ReportColumn("Rating", "RANK", "{0}"));
            for (int i = Int32.Parse(Utility.CurrentWeek()); i > -1; i--)
            {
                string colName = string.Format("Week{0:0#}", i);
                str.AddColumn(new ReportColumn(colName, colName, "{0}"));
            }

            str.LoadBody(dt);
            str.RenderAsHtml(
                string.Format("{0}Gordan{1}{2}.htm", Utility.OutputDirectory(), s.Year, Utility.CurrentWeek()),
                true);
        }
Example #40
0
        public override void RenderAsHtml()
        {
            var str = new SimpleTableReport("Run Report");
             str.AddDenisStyle();
             str.ColumnHeadings = true;
             str.DoRowNumbers = false;
             str.ShowElapsedTime = true;
             str.IsFooter = false;
             str.AddColumn( new ReportColumn( "Machine", "MACHINE", "{0}", typeof( String ) ) );
             str.AddColumn( new ReportColumn( "Report", "REPORT", "{0}", typeof( String ) ) );
             str.AddColumn( new ReportColumn( "Finished", "FINISHED", "{0}", typeof( String ) ) );
             str.AddColumn( new ReportColumn( "At", "FINISHAT", "{0}", typeof( String ) ) );
             str.AddColumn( new ReportColumn( "Elapsed", "ELAPSED", "{0}", typeof( string ) ) );

             BuildTable( str );
             //str.SetSortOrder( "FINISHED DESC" );
             str.RenderAsHtml( OutputFilename(), true );
             Finish();
        }
Example #41
0
 public void Render()
 {
     var str = new SimpleTableReport( string.Format( "Tipping Comp - {0:d}", DateTime.Now ) );
     str.AddStyle( "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 761px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle( "#main { margin-left:1em; }" );
     str.AddStyle( "#dtStamp { font-size:0.8em; }" );
     str.AddStyle( ".end { clear: both; }" );
     str.AddStyle( ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Method", "METHOD", "{0}", typeof( String ), false ) );
     str.AddColumn( new ReportColumn( "Wins", "WINS", "{0}", typeof( Int32 ), tally: true ) );
     str.AddColumn( new ReportColumn( "Losses", "LOSSES", "{0}", typeof( Int32 ), tally:true ) );
     str.AddColumn( new ReportColumn( "Ties", "TIES", "{0}", typeof( Int32 ), tally: true ) );
     str.AddColumn( new ReportColumn( "Clip", "CLIP", "{0:#.##0}", typeof( Decimal ), false ) );
     BuildTable( str );
     str.SetSortOrder( "Clip DESC" );
     str.RenderAsHtml( OutputFilename, true );
 }
Example #42
0
        public void Render()
        {
            LoadTeams();

            var heading = Week == null ? "Scores Season " + Season : "Scores : Week " + Week;
            var str = new SimpleTableReport( heading );
            str.ColumnHeadings = true;
            str.DoRowNumbers = true;
            str.AddColumn( new ReportColumn( "Team", "TEAM", "{0,-20}" ) );
            str.AddColumn( new ReportColumn( "Total", "TOTAL", "{0}" ) );
            str.AddColumn( new ReportColumn( "Passes", "TDp", "{0}" ) );
            str.AddColumn( new ReportColumn( "Runs", "TDr", "{0}" ) );
            str.AddColumn( new ReportColumn( "Punt returns", "TDt", "{0}" ) );
            str.AddColumn( new ReportColumn( "KO returns", "TDk", "{0}" ) );
            str.AddColumn( new ReportColumn( "Int returns", "TDi", "{0}" ) );
            str.AddColumn( new ReportColumn( "Fumble returns", "TDf", "{0}" ) );
            str.LoadBody( BuildTable() );
            FileOut = Week == null ? string.Format( "{0}//Scores/{1}//Scores.htm", Utility.OutputDirectory(), Season )
                : string.Format( "{0}//Scores/{1}//Scores-{2}.htm",Utility.OutputDirectory(), Season, Week );
            str.RenderAsHtml( FileOut, true );
        }
Example #43
0
 /// <summary>
 ///   Creates the output.
 /// </summary>
 public void Render()
 {
     SimpleTableReport str = new SimpleTableReport( string.Format( "{0}-{1}",
                                                                   StatCode, Team.TeamCode ) );
     str.AddStyle(  "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle(  "#main { margin-left:1em; }" );
     str.AddStyle(  "#dtStamp { font-size:0.8em; }" );
     str.AddStyle(  ".end { clear: both; }" );
     str.AddStyle(  ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = false;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Week",      "WEEK",   "{0}", typeof( String )       ) );
     str.AddColumn( new ReportColumn( "Opp",       "OPP",    "{0}", typeof( String )       ) );
     str.AddColumn( new ReportColumn( "Count",     "COUNT",  "{0}", typeof( String ), true ) );
     str.AddColumn( new ReportColumn( "Who",       "WHO",    "{0}", typeof( String )       ) );
     BuildTable( str );
     //str.SubHeader = SubHeading();
     str.RenderAsHtml(string.Format("{0}{1}-{2}.htm", Utility.OutputDirectory(), Team.TeamCode, StatCode), true);
 }
Example #44
0
        public void Render(string header)
        {
            //  Output the list
            Heading = header;
            Utility.Announce("TeamListing " + Heading);
            var r = new SimpleTableReport(Heading, "") {DoRowNumbers = true};

            if (!string.IsNullOrEmpty(SubHeading))
                r.SubHeader = SubHeading;

            var ds = LoadData();

            r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
            r.AddColumn(new ReportColumn("Sacks", "SACKS", "{0,9}"));
            r.AddColumn(new ReportColumn("Interceptions", "INTERCEPTS", "{0,4}"));
            r.AddColumn(new ReportColumn("Points", "POINTS", "{0,5}"));
            var dt = ds.Tables[0];
            dt.DefaultView.Sort = "Points DESC";
            r.LoadBody(dt);
            FileOut = string.Format("{0}{1}.htm", Utility.OutputDirectory(), Heading);
            r.RenderAsHtml( FileOut, true );
        }
        public string RenderProjectedData(ArrayList playerList, string sHead, [Optional] string sortOrder, 
         IRatePlayers scorer, IWeekMaster weekMaster  )
        {
            //  Output the list
             Utility.Announce("PlayerListing " + sHead);

             var r = new SimpleTableReport {
            ReportHeader = sHead,
            ReportFooter = Season,
            DoRowNumbers = true};

             if (!string.IsNullOrEmpty(SubHeader)) r.SubHeader = SubHeader;
             ///////////////////////////////////////////////////////////////
             var ds = LoadProjectedData(playerList, scorer, weekMaster ); //  <-- projection action here
             ///////////////////////////////////////////////////////////////
             r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
             r.AddColumn(new ReportColumn("Pos", "POS", "{0,9}"));
             r.AddColumn(new ReportColumn("Role", "ROLE", "{0,9}"));
             r.AddColumn(new ReportColumn("RookieYr", "ROOKIEYR", "{0,4}"));
             r.AddColumn(new ReportColumn("Team", "CURRTEAM", "{0,2}"));
             if (ShowOpponent)
             {
            r.AddColumn(new ReportColumn("Opp", "OPPONENT", "{0,2}"));
            r.AddColumn(new ReportColumn("Opp", "OPPRATE", "{0,2}"));
            r.AddColumn(new ReportColumn("Spread", "SPREAD", "{0,5}"));
             }
             r.AddColumn(new ReportColumn("Age", "AGE", "{0,2}"));
             r.AddColumn(new ReportColumn("Owner", "FT", "{0,2}"));
             if (LongStats)
             {
            r.AddColumn(new ReportColumn("Curr", "CURSCORES", "{0,5}"));
            r.AddColumn(new ReportColumn("Tot", "SCORES", "{0,5}"));
            r.AddColumn(new ReportColumn("Avg", "AVG", "{0:0.0}"));
            r.AddColumn(new ReportColumn("Inj", "INJURY", "{0,5}"));
            r.AddColumn(new ReportColumn("YDp", "YDP", "{0,5}"));
            r.AddColumn(new ReportColumn("Tdp", "TDP", "{0,5}"));
            r.AddColumn(new ReportColumn("YDr", "YDR", "{0,5}"));
            r.AddColumn(new ReportColumn("Tdr", "TDR", "{0,5}"));
            r.AddColumn(new ReportColumn("YDc", "YDC", "{0,5}"));
            r.AddColumn(new ReportColumn("TDc", "TDC", "{0,5}"));
            r.AddColumn(new ReportColumn("Fg", "Fg", "{0,5}"));
             }
             r.AddColumn(new ReportColumn("Points", "POINTS", "{0,5}"));

             var dt = ds.Tables[0];
             dt.DefaultView.Sort = LongStats
            ? (string.IsNullOrEmpty(sortOrder) ? "Points DESC" : sortOrder) : "Points DESC";

             r.LoadBody(dt); //  just assigns the data table
             FileOut = string.Format("{0}{1}.htm", Utility.OutputDirectory(), sHead);
             r.RenderAsHtml( FileOut, true);

             if (RenderToCsv)
            r.RenderAsCsv("Starters-" + sHead);
             return FileOut;
        }
Example #46
0
        private static void Render( string season, string week, DataTable dt )
        {
            var str = new SimpleTableReport
              	                        	{
              	                        		ReportHeader = "Gordan Line : Week " + week,
                                 		ColumnHeadings = true,
                                 		DoRowNumbers = true
                                 	};
              	str.AddColumn( new ReportColumn( "Away Team", "AWAY", "{0,-20}" ) );
             str.AddColumn( new ReportColumn( "ALR", "AWAYLETTER", "{0,-2}" ) );
             str.AddColumn( new ReportColumn( "Home Team", "HOME", "{0,-20}" ) );
             str.AddColumn( new ReportColumn( "HLR", "HOMELETTER", "{0,-2}" ) );
             str.AddColumn( new ReportColumn( "Spread", "SPREAD", "{0:#0.0}" ) );
             str.AddColumn( new ReportColumn( "GordLine", "GLINE", "{0:#0.0}" ) );
             str.AddColumn(new ReportColumn("MyTip", "MYTIP", "{0:#0.0}"));
             str.AddColumn(new ReportColumn("Diff", "DIFF", "{0:#0.0}"));
             str.AddColumn( new ReportColumn( "AwSR", "ASR", "{0}" ) );
             str.AddColumn( new ReportColumn( "HmSR", "HSR", "{0}" ) );

             str.AddColumn( new ReportColumn( "Bet", "BET", "{0,-20}" ) );
             str.AddColumn( new ReportColumn( "Away", "AWAYSCORE", "{0}" ) );
             str.AddColumn( new ReportColumn( "Home", "HOMESCORE", "{0}" ) );
             str.AddColumn( new ReportColumn( "Result", "RESULT", "{0}" ) );
             str.AddColumn( new ReportColumn( "Adjustment", "ADJUST", "{0}" ) );
             str.LoadBody( dt );
             str.RenderAsHtml(
            string.Format("{0}GordanLine{1}{2}.htm", Utility.OutputDirectory(), season, week),
            true );
        }
Example #47
0
 public void Render()
 {
     NflSeason = new NflSeason( Year, loadGames: false, loadDivisions: false);
      NflSeason.LoadRegularWeeks();
      var str = new SimpleTableReport( string.Format( "Score Grid {0}-{1}", NflSeason.Year, ScopeInFocus ) ) { ReportHeader = ScopeInFocus };
      StyleHelper.AddStyle( str );
      str.ColumnHeadings = true;
      str.DoRowNumbers = false;
      str.ShowElapsedTime = false;
      str.IsFooter = false;
      str.AddColumn( new ReportColumn( "Stat", "STAT", "{0}" ) );
      str.AddColumn( new ReportColumn( "Total", "TOT", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk01", "WK01", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk02", "WK02", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk03", "WK03", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk04", "WK04", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk05", "WK05", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk06", "WK06", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk07", "WK07", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk08", "WK08", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk09", "WK09", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk10", "WK10", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk11", "WK11", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk12", "WK12", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk13", "WK13", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk14", "WK14", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk15", "WK15", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk16", "WK16", "{0}" ) );
      str.AddColumn( new ReportColumn( "Wk17", "WK17", "{0}" ) );
      str.LoadBody( BuildTable() );
      //str.SubHeader = SubHeading();
      str.RenderAsHtml( FileName(), true );
 }
Example #48
0
        public void RenderAsHtml( string fileName, string season )
        {
            var st = new SimpleTableReport( "Frequency Table " + name, StdFooter()) {ColumnHeadings = true};

            st.AddColumn( new ReportColumn( "Occurence",    "Occurence",  "{0:##0}"   ) );
            st.AddColumn( new ReportColumn( "Freq.",        "Frequency",  "{0}"       ) );
            st.AddColumn( new ReportColumn( "Cum. Freq.",   "Cumulative", "{0}"       ) );
            st.AddColumn( new ReportColumn( "Percent ",     "Percent",    "{0:##0.0}" ) );
            st.AddColumn( new ReportColumn( "Cum. %",       "TotPercent", "{0:##0.0}" ) );

            st.LoadBody( dt );
            st.DoRowNumbers = false;
            st.ShowElapsedTime = false;
            FileName = string.Format("{0}{2}\\Frequency\\{1}.htm", Utility.OutputDirectory(), name, season);
             st.RenderAsHtml( FileName, true);
        }
        public string RenderData(ArrayList playerList, string sHead, NFLWeek week)
        {
            //  Output the list
             var r = new SimpleTableReport {ReportHeader = sHead, ReportFooter = "", DoRowNumbers = true};

             var ds = LoadData(playerList, week);

             r.AddColumn(new ReportColumn("Name", "NAME", "{0,-15}"));
             r.AddColumn(new ReportColumn("Team", "CURRTEAM", "{0,2}"));
             r.AddColumn(new ReportColumn("Role", "ROLE", "{0,1}"));
             r.AddColumn(new ReportColumn("Owner", "FT", "{0,2}"));
             r.AddColumn(new ReportColumn("Total", "tot", "{0,5}"));

             var startAt = FullStart ? Constants.K_WEEKS_IN_A_SEASON : Constants.K_WEEKS_IN_REGULAR_SEASON;

             for (var w = startAt; w > 0; w--)
             {
            var header = string.Format("Week {0}", w);
            var fieldName = string.Format(FieldFormat, w);

            if ( IsGridStatsQBReport( sHead ) )
                r.AddColumn( new ReportColumn(header, fieldName, "{0,5}", QbBgPicker) );
            if ( IsYahooQbReport( sHead) )
                r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnQbBgPicker));
            if (  IsYahooRbReport( sHead ) )
               r.AddColumn( new ReportColumn(header, fieldName, "{0,5}", EspnRbBgPicker));
            if ( IsYahooWrReport( sHead ) )
               r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnWrBgPicker));
            if ( IsYahooTeReport( sHead ) )
               r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", EspnTeBgPicker));
            if ( IsYahooPkReport( sHead ) )
               r.AddColumn( new ReportColumn( header, fieldName, "{0,5}", EspnPkBgPicker ) );

             }

             var dt = ds.Tables[0];
             dt.DefaultView.Sort = "tot DESC";
             r.LoadBody(dt);
             FileOut =  sHead;
             r.RenderAsHtml( FileOut, true);
             return FileOut;
        }
Example #50
0
 //public void RenderTeam( string teamCode )
 //{
 //   var team = new NflTeam( teamCode );
 //   RenderTeam( team );
 //}
 public void RenderTeam( NflTeam team, bool skipPostseason )
 {
     if ( team.MetricsHt == null ) LoadTeam( team, team.TeamCode, skipPostseason );
     var metricsHt = team.MetricsHt;
     var str = new SimpleTableReport( string.Format( "Metrics-{0}", team.TeamCode ) );
     str.AddStyle(  "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 761px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle(  "#main { margin-left:1em; }" );
     str.AddStyle(  "#dtStamp { font-size:0.8em; }" );
     str.AddStyle(  ".end { clear: both; }" );
     str.AddStyle(  ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Week",       "WeekSeed",  "{0}", typeof( String ), false       ) );
     str.AddColumn( new ReportColumn( "OffTDp",      "OffTDp",   "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Mult",        "AvgOffTDp", "{0:#.#}", typeof( Decimal ), false   ) );
     str.AddColumn( new ReportColumn( "OffTDr",      "OFFTDR",   "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Mult",         "AvgOffTDr", "{0:#.#}", typeof( Decimal ), false   ) );
     str.AddColumn( new ReportColumn( "OffSAKa",     "OFFSAKa",  "{0}", typeof( Decimal ), true ) );
     str.AddColumn( new ReportColumn( "Mult",         "AvgOffSaka", "{0:#.#}", typeof( Decimal ), false   ) );
     str.AddColumn( new ReportColumn( "DefTDpa",     "DefTDpa",  "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Mult",         "AvgDefTDp", "{0:#.#}", typeof( Decimal ), false   ) );
     str.AddColumn( new ReportColumn( "DefTDra",     "DEFTDRa",  "{0}", typeof( Int32 ), true       ) );
     str.AddColumn( new ReportColumn( "Mult",         "AvgDefTDr", "{0:#.#}", typeof( Decimal ), false   ) );
     str.AddColumn( new ReportColumn( "DefSAK",      "DEFSAK",   "{0}", typeof( Decimal ), true ) );
     str.AddColumn( new ReportColumn( "Mult",         "AvgDefSak", "{0:#.#}", typeof( Decimal ), false   ) );
     BuildTable( str, metricsHt, team );
     str.SetSortOrder( "WeekSeed" );
      str.RenderAsHtml(string.Format("{0}Metrics-{1}.htm", Utility.OutputDirectory(), team.TeamCode), true);
 }
 public void Render()
 {
     var str = new SimpleTableReport(string.Format("Suggested Lineup {0}:{1:#0} {2}", Season, Week, LeagueId));
      str.AddDenisStyle();
      str.ColumnHeadings = true;
      str.DoRowNumbers = false;
      str.ShowElapsedTime = false;
      str.IsFooter = false;
      str.AddColumn(new ReportColumn("Slot", "SLOT", "{0:00}"));
      str.AddColumn(new ReportColumn("Player", "PLAYER", "{0}"));
      str.AddColumn(new ReportColumn("Team", "TEAM", "{0}"));
      str.AddColumn(new ReportColumn("Pos", "POS", "{0}"));
      str.AddColumn(new ReportColumn("RPoints", "PTS", "{0}"));
      str.AddColumn(new ReportColumn("Role", "ROLE", "{0}"));
      str.AddColumn(new ReportColumn("Game", "GAME", "{0}"));
      str.AddColumn(new ReportColumn("OppUnit", "OPPRATE", "{0}"));
      str.AddColumn(new ReportColumn("Spread", "SPREAD", "{0:##.#}"));
      str.AddColumn(new ReportColumn("Total", "TOTAL", "{0:##.#}"));
      str.AddColumn(new ReportColumn("Actual", "ACTUAL", "{0:##}"));
      str.LoadBody(BuildTable());
      str.SetSortOrder( "SLOT,PTS DESC" );
      str.RenderAsHtml(FileName(), true);
 }
Example #52
0
        public string SpitLineups(bool bPersist)
        {
            var usedDs = Utility.TflWs.PositionsUsed(TeamCode, Season);
             var ds = CreatePositions();

             var posTable = ds.Tables[0];

             var str = new SimpleTableReport
                     {
                        ReportHeader = "Lineups :" + TeamCode + " Season " + Season,
                        ColumnHeadings = true
                     };
             str.AddColumn(new ReportColumn("Pos", "POS", "{0,-10}"));

             // Only add the columns for the last 12 weeks
             for (int i = 1; i <= 10; i++)
             {
            var colName = "Wk" + String.Format("{0:0#}", Week(i));
            var colHead = "Wk " + String.Format("{0:0#}", Week(i));
            str.AddColumn(new ReportColumn(colHead, colName, "{0,-20}"));
             }
             str.LoadBody(LineupTable(posTable, usedDs));
             var outputfile = LineupFile();
             var html = str.RenderAsHtml(outputfile, bPersist);
             return html;
        }
        /// <summary>
        ///   This is a model SimpleTableReport, using expanded ReportColumn constructors
        /// </summary>
        public void RosterReport()
        {
            var week = Int32.Parse( Utility.CurrentWeek() );
            var when = string.Format( "Week{0}-{1:00}", Season,  week );
            var str = new SimpleTableReport(string.Format("GridStats Roster : {0}", when))
                      	{
                                ColumnHeadings = true,
                                DoRowNumbers = true
                            };
            str.AddColumn( new ReportColumn( "Team",     "FTEAM",     "{0,-20}"     ) );
            str.AddColumn( new ReportColumn( "Value",    "VALUE",     "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Size",     "SIZE",      "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Avg",      "AVG",       "{0:#.#}"     ) );
            str.AddColumn( new ReportColumn( "Starters", "STARTERS",  "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Backups",  "BACKUPS",   "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Others",   "OTHERS",    "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Injured",  "INJURIES",  "{0}" , true  ) );
            str.AddColumn( new ReportColumn( "TeamBias", "BIAS",      "{0,-10}"     ) );

            str.LoadBody( BuildTable() );
            FileOut = string.Format( "{0}{1}\\RosterSummary\\{2}\\RosterSummary-{3:00}.htm",
                Utility.OutputDirectory(), Season, CompCode, week );
            str.RenderAsHtml( FileOut, true );
        }
        /// <summary>
        ///   Looks at the EP xml to dump out a report
        /// </summary>
        public void RosterExperience()
        {
            Utility.Announce("NFLRosterReport.RosterExperience - creating simple report");

            CheckPreRequisites();

            var str =
                new SimpleTableReport(string.Format("Roster Experience {0}", Utility.CurrentSeason()));
            str.AddStyle(
                "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
            str.AddStyle("#main { margin-left:1em; }");
            str.AddStyle("#dtStamp { font-size:0.8em; }");
            str.AddStyle(".end { clear: both; }");
            str.AddStyle(".gponame { color:white; background:black }");
            str.ColumnHeadings = true;
            str.DoRowNumbers = true;
            str.ShowElapsedTime = false;
            str.IsFooter = false;
            str.AddColumn(new ReportColumn("Team", "TEAM", "{0}", typeof (String)));
            str.AddColumn(new ReportColumn("Player", "PLAYER", "{0}", typeof (String)));
            str.AddColumn(new ReportColumn("Unit", "UNIT", "{0}", typeof (String)));
            str.AddColumn(new ReportColumn("EP", "EP", "{0}", typeof (Int32), true));
            BuildTable(str);
            str.SetSortOrder("EP DESC");
            str.RenderAsHtml(
                string.Format("{0}Experience-{1}-{2}.htm", Utility.OutputDirectory(), Utility.CurrentSeason(),
                              Utility.CurrentWeek()), true);
        }
Example #55
0
 public void Render()
 {
     var str = new SimpleTableReport( string.Format( "Stat Grid {0}-{1}", Season.Year, StatInFocus ) )
              {ReportHeader = StatInFocus};
      StyleHelper.AddStyle( str );
      str.ColumnHeadings = true;
      str.DoRowNumbers = true;
      str.ShowElapsedTime = false;
      str.IsFooter = false;
      str.Totals = true;
      str.AddColumn( new ReportColumn( "Team", "TEAM", "{0}" ) );
      str.AddColumn( new ReportColumn( "Total", "TOT", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk01", "WK01", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk02", "WK02", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk03", "WK03", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk04", "WK04", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk05", "WK05", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk06", "WK06", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk07", "WK07", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk08", "WK08", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk09", "WK09", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk10", "WK10", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk11", "WK11", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk12", "WK12", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk13", "WK13", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk14", "WK14", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk15", "WK15", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk16", "WK16", "{0}", tally: true ) );
      str.AddColumn( new ReportColumn( "Wk17", "WK17", "{0}", tally: true ) );
      str.LoadBody( BuildTable() );
      //str.SubHeader = SubHeading();
      str.RenderAsHtml( FileName(), true );
 }
        public void GameRatings( NFLWeek week, string fTeamOwner )
        {
            var when = string.Format( "Week{0}-{1:0#}", week.Season, Int32.Parse( week.Week ) );
            #if DEBUG
            Utility.Announce( string.Format( "   GameRatings for {0} owner {1}", when, fTeamOwner ) );
            #endif
            var str = new SimpleTableReport( string.Format( "Game Ratings {1}: {0:0#}", when, Name ) )
                      	{ColumnHeadings = true, DoRowNumbers = true};
            str.AddColumn( new ReportColumn( "Rating",   "RATING",    "{0}", typeof( Int32 ), true   ) );
            str.AddColumn( new ReportColumn( "Day",      "DAY",       "{0}", typeof( String)  ) );
            str.AddColumn( new ReportColumn( "Time",     "HOUR",      "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "AT",       "AT",        "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "HT",       "HT",        "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "TV",       "TV",        "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "Fav",      "FAV",       "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "Spr",      "SPREAD",    "{0}", typeof( String)    ) );
            str.AddColumn( new ReportColumn( "myTip",    "TIP",    "{0}", typeof( String)    ) );

            BuildRatingsTable( str, fTeamOwner, week );

             str.RenderAsHtml(string.Format("{0}Ratings{2}{1}.htm", Utility.OutputDirectory(), when, CompCode), true);
        }
        public string RenderData(ArrayList unitList, string sHead, NFLWeek week)
        {
            //  Output the list
            var tu1 = (TeamUnit) unitList[0];
            var r = new SimpleTableReport {ReportHeader = sHead, ReportFooter = "", DoRowNumbers = true};
            var ds = LoadData(unitList, week);
            r.AddColumn(new ReportColumn("Name", "TEAM", "{0,-15}"));
            r.AddColumn(new ReportColumn("Rating", "RATING", "{0,-1}"));
            r.AddColumn(new ReportColumn("Total", "tot", "{0,5}"));

            const int startAt = Constants.K_WEEKS_IN_A_SEASON;

            var currentWeek = new NFLWeek(Int32.Parse(Utility.CurrentSeason()), Int32.Parse(Utility.CurrentWeek()), false);

            for (var w = startAt; w > 0; w--)
            {
                var header = string.Format("Week {0}", currentWeek.Week);
                var fieldName = string.Format(FieldFormat, currentWeek.WeekNo);

                r.AddColumn(new ReportColumn(header, fieldName, "{0,5}", tu1.BGPicker));
                currentWeek = currentWeek.PreviousWeek(currentWeek, true, false );
            }

            var dt = ds.Tables[0];

            dt.DefaultView.Sort = "tot " + tu1.SortDirection();
            r.LoadBody(dt);
            FileOut = string.Format( "{0}Units\\{1}.htm", Utility.OutputDirectory(), sHead );
            r.RenderAsHtml( FileOut, true);
            return FileOut;
        }
Example #58
0
        /// <summary>
        ///   This is a model SimpleTableReport, using expanded ReportColumn constructors
        /// </summary>
        public void RosterReport()
        {
            string when = string.Format( "Week{0}-{1:00}", Season, Int32.Parse( Utility.CurrentWeek() ) );
            SimpleTableReport str = new SimpleTableReport( string.Format( "ESPN Roster : {0}", when ) );
            str.ColumnHeadings = true;
            str.DoRowNumbers = true;
            str.AddColumn( new ReportColumn( "Team",     "FTEAM",     "{0,-20}"     ) );
            str.AddColumn( new ReportColumn( "Value",    "VALUE",     "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Size",     "SIZE",      "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Avg",      "AVG",       "{0:#.#}"     ) );
            str.AddColumn( new ReportColumn( "Starters", "STARTERS",  "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Backups",  "BACKUPS",   "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Others",   "OTHERS",    "{0}", true   ) );
            str.AddColumn( new ReportColumn( "Injured",  "INJURIES",  "{0}" , true  ) );
            str.AddColumn( new ReportColumn( "TeamBias", "BIAS",      "{0,-10}"     ) );

            str.LoadBody( BuildTable() );
            str.RenderAsHtml(string.Format("{0}rosters\\Roster{2}{1}.htm", Utility.OutputDirectory(), when, CompCode), true);
        }
        public void DumpProjections()
        {
            Utility.Announce("Dumping Projections");

               if (ProjectionList == null) return;

               //  for each projection in the report
               foreach (var pl in ProjectionList)
               {
              var metricName = (String) pl;
              //    load the totals into a simple report
              var dt = new DataTable();
              var cols = dt.Columns;
              cols.Add("TEAM", typeof (String));
              cols.Add("STARTER", typeof (String));
              cols.Add("TOTAL", typeof (Decimal));
              cols.Add("GS", typeof (String));
              cols.Add("G2", typeof (String));

              foreach (NFLDivision d in Afc.DivList)
              {
                 foreach (NflTeam t in d.TeamList)
                 {
                    foreach (NFLOutputMetric m in t.ProjectionList)
                    {
                       if (m.Name == metricName)
                       {
                          AddRow(dt, m.Total, t, metricName);
                          break;
                       }
                    }
                 }
              }
              foreach (NFLDivision d in Nfc.DivList)
              {
                 foreach (NflTeam t in d.TeamList)
                 {
                    foreach (NFLOutputMetric m in t.ProjectionList)
                    {
                       if (m.Name == metricName)
                       {
                          AddRow(dt, m.Total, t, metricName);
                          break;
                       }
                    }
                 }
              }
              var st = new SimpleTableReport {ReportHeader = "Projected " + metricName, ColumnHeadings = true};
              st.AddColumn(new ReportColumn("Team", "TEAM", "{0,-20}"));
              st.AddColumn(new ReportColumn("Starter", "STARTER", "{0,-20}"));
              st.AddColumn(new ReportColumn("Total", "TOTAL", "{0:##0}", true));
              st.AddColumn(new ReportColumn("GS11", "GS", "{0,-10}"));
              st.AddColumn(new ReportColumn("GS3", "G2", "{0,-10}"));
              dt.DefaultView.Sort = "TOTAL DESC";
              st.LoadBody(dt);
              st.ShowElapsedTime = false;
              st.RenderAsHtml(
                 string.Format("{0}{2}\\Projections\\Projected-{1}.htm",
                    Utility.OutputDirectory(), metricName, Utility.CurrentSeason()), true);
               }
        }
 /// <summary>
 ///   Creates the output.
 /// </summary>
 public void Render()
 {
     var str = new SimpleTableReport("Player Projection " + Player.PlayerName + "-" + Season);
      str.AddStyle(
     "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }");
      str.AddStyle("#main { margin-left:1em; }");
      str.AddStyle("#dtStamp { font-size:0.8em; }");
      str.AddStyle(".end { clear: both; }");
      str.AddStyle(".gponame { color:white; background:black }");
      str.AddStyle(
     "label { display:block; float:left; width:130px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:right; }");
      str.AddStyle(
     "value { display:block; float:left; width:100px; padding: 3px 5px; margin: 0px 0px 5px 0px; text-align:left; font-weight: bold; color:blue }");
      str.AddStyle(
     "#notes { float:right; height:auto; width:308px; font-size: 88%; background-color: #ffffe1; border: 1px solid #666666; padding: 5px; margin: 0px 0px 10px 10px; color:#666666 }");
      str.AddStyle(
     "div.notes H4 { background-image: url(images/icon_info.gif); background-repeat: no-repeat; background-position: top left; padding: 3px 0px 3px 27px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #666666; color: #666666; font-size: 110%;}");
      str.ColumnHeadings = true;
      str.DoRowNumbers = false;
      str.ShowElapsedTime = false;
      str.IsFooter = false;
      str.AddColumn(new ReportColumn("Week", "WEEK", "{0}"));
      str.AddColumn(new ReportColumn("Matchup", "MATCH", "{0}"));
      str.AddColumn(new ReportColumn("Score", "SCORE", "{0}"));
      str.AddColumn(new ReportColumn("OppUnit", "OPPRATE", "{0}"));
      str.AddColumn(new ReportColumn("Proj", "PROJ", "{0:0.0}", true));
      str.AddColumn(new ReportColumn("Y-FP", "FP", "{0:0.0}", true));
      str.AddColumn(new ReportColumn("Stats", "STATS", "{0}"));
      str.AddColumn(new ReportColumn("Actual", "ACTUAL", "{0:0.0}", true));
     str.AddColumn(new ReportColumn("ActStats", "ACTUALSTAT", "{0:0.0}"));
      str.AddColumn(new ReportColumn("Variation", "VAR", "{0:0.0}", tally:true));
      str.LoadBody(BuildTable());
      str.SubHeader = SubHeading();
      str.RenderAsHtml(FileName(), true);
 }