/// <summary> /// Express the report in HTML. /// </summary> /// <param name="fileName">The output DOS file fame. Include a directory.</param> /// <param name="persist">Whether to delete the file or not, sometimes we just want the string.</param> public string RenderAsHtml(string fileName, bool persist) { if (ReportHeader == null) { ReportHeader = _header; } ReportHeader = string.Format("{0} as of {1}", ReportHeader, DateTime.Now.ToString("ddd dd MMM yy HH:MM tt")); var h = new HtmlFile(fileName, ReportHeader) { AnnounceIt = AnnounceIt }; AddStyles(h); var html = string.Format("<h3>{0}</h3>", ReportHeader) + Header(_header); if (SubHeader.Length > 0) { html += SubHeader; } html += BodyOut(); h.AddToBody(html); _et.Stop(DateTime.Now); TimeTaken = _et.TimeOut(); if (!string.IsNullOrEmpty(FootNote)) { h.AddToBody(FootNote); } h.AddToBody(IsFooter ? ReportFooter : Footer()); if (persist) { h.Render(); } return(html); }
public void Render(string season) { var s = Masters.Sm.GetSeason(season); foreach (string teamKey in s.TeamKeyList) { var t = Masters.Tm.GetTeam(teamKey); Utility.Announce(string.Format("Unit reports for {0}", t.NameOut())); var fileOut = string.Format("{0}\\{2}\\Units\\{1}-Units.htm", Utility.OutputDirectory(), t.TeamCode, season); var h = new HtmlFile(fileOut, string.Format(" Unit Reports as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek())); h.AddToBody(Header(t)); h.AddToBody(t.UnitReport()); h.Render(); PoSnippet(t); RoSnippet(t); PpSnippet(t); PrSnippet(t); RdSnippet(t); PdSnippet(t); } }
public string RenderHtml() { FileOut = $@"{Utility.OutputDirectory()}{ Season }//{ Folder }//{ InstanceName }.htm" ; if (!string.IsNullOrEmpty(InstanceName)) { ReportHeader = $"{InstanceName}"; } else { ReportHeader = $"{ReportType}"; } var reportHeader = $@"{ReportHeader} as of { DateTime.Now.ToString("ddd dd MMM yy HH:MM tt") }" ; var h = new HtmlFile(FileOut, reportHeader); var html = $"<h3>{reportHeader}</h3>"; html += $"<pre>{Body}</pre>"; h.AddToBody(html); h.Render(); return(html); }
public void SeasonProjection( string metricName, string season, string week, DateTime projectionDate) { Announce($"SeasonProjection metric={metricName} ..."); FileOut = ProjectionFileName( metricName, season); _html = new HtmlFile( FileOut, " Win Projections as of " + projectionDate.ToString("ddd dd MMM yy")); _html.AddToBody( Header("Season Projections " + metricName + " - " + season)); _html.AddToBody( SeasonOut( metricName, projectionDate)); _html.Render(); ProjectionList.Add( metricName); Utility.CopySubFile( ProjectionFileName1( metricName, season), ProjectionFileName2( metricName, season, week)); }
public void TeamUnits(string season, string teamKey) { var t = Masters.Tm.GetTeam(teamKey); Utility.Announce($"Unit reports for {t.NameOut()}"); var fileOut = $"{Utility.OutputDirectory()}\\{season}\\Units\\{t.TeamCode}-Units.htm"; var h = new HtmlFile(fileOut, $@" Unit Reports as of {DateTime.Now.ToString("dd MMM yy")} Week { Utility.CurrentWeek() }" ); h.AddToBody(Header(t)); h.AddToBody(t.UnitReport()); h.Render(); PoSnippet(t); #if !DEBUG2 RoSnippet(t); PpSnippet(t); PrSnippet(t); RdSnippet(t); PdSnippet(t); #endif }
public void PredictSeason( string season, DateTime projectionDate, string fileOut ) { var html = new HtmlFile( fileOut, " Win Projections as of " + projectionDate.ToString( "ddd dd MMM yy" ) ); html.AddToBody( Header( "Season Projections - Hillin Predictor - " + season ) ); html.AddToBody( SeasonOut( "Spread", projectionDate, season ) ); html.Render(); }
public void PredictSeason(string season, DateTime projectionDate, string fileOut) { var html = new HtmlFile(fileOut, " Win Projections as of " + projectionDate.ToString("dd MMM yy")); html.AddToBody(Header("Season Projections - Nibble Predictor - " + season)); html.AddToBody(SeasonOut("Spread", projectionDate, season)); html.Render(); }
private void AddStyles(HtmlFile h) { var styleEnumerator = StyleList.GetEnumerator(); while (styleEnumerator.MoveNext()) { h.AddStyle(styleEnumerator.Current.ToString()); } }
public void Render() { var fileOut = string.Format("{0}{2}/TeamCards/TeamCard_{1}.htm", Utility.OutputDirectory(), Team.TeamCode, Team.Season); var h = new HtmlFile(fileOut, "Team Card " + DateTime.Now.ToString("dd MMM yy HH:mm")); h.AddToBody(CardOut()); h.Render(); }
public void CurrentRoster() { FileOut = string.Format("{0}{1}\\RosterReport\\RosterReport.htm", Utility.OutputDirectory(), Season); _html = new HtmlFile(FileOut, "NFL Rosters as of " + DateTime.Now.ToString("ddd dd MMM yy HH:mm"), "dir='ltr' xmlns:v='urn:schemas-microsoft-com:vml' gpmc_reportInitialized='false'", "report.css", "report.vb", "report.js"); }
public void PpSnippet(NflTeam t) { FileOut = string.Format("{0}\\Prot\\PP-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Pass Protection Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderPp(t)); h.AddToBody(t.PpReport()); h.Render(); }
public void CurrentRoster() { FileOut = string.Format("{0}{1}\\RosterReport\\RosterReport.htm", Utility.OutputDirectory(), Season ); _html = new HtmlFile(FileOut, "NFL Rosters as of " + DateTime.Now.ToString("ddd dd MMM yy HH:mm"), "dir='ltr' xmlns:v='urn:schemas-microsoft-com:vml' gpmc_reportInitialized='false'", "report.css", "report.vb", "report.js"); }
public void RoSnippet(NflTeam t) { FileOut = string.Format("{0}\\RunOff\\RO-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Rushing Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderRo(t)); h.AddToBody(t.RoReport()); h.Render(); }
public void PdSnippet(NflTeam t) { FileOut = string.Format("{0}\\PassDef\\PD-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Pass Defense Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderPd(t)); h.AddToBody(t.PdReport()); h.Render(); }
public string Render() { var fileOut = $"{Utility.OutputDirectory()}{Team.Season}/TeamCards/TeamCard_{Team.TeamCode}.htm"; var h = new HtmlFile( fileOut, "Team Card " + DateTime.Now.ToString("dd MMM yy HH:mm")); h.AddToBody(CardOut()); h.Render(); return(fileOut); }
public void KickerProjection() { Announce("Kicker Projections"); FileOut = string.Format("{0}Kickers\\Kickers_{1}.htm", Utility.OutputDirectory(), Utility.CurrentSeason()); _html = new HtmlFile(FileOut, " Kicker Projections as of " + DateTime.Now.ToString("ddd dd MMM yy")); _html.AddToBody(Header("Kicker Projections")); _html.AddToBody(KickersOut()); _html.Render(); }
public void CurrentInjuries() { FileOut = string.Format("{0}Rosters\\{2}\\{3}\\Injuries{1}.htm", Utility.OutputDirectory(), StrCat, Season, CurrentLeague ); var h = new HtmlFile( FileOut, Utility.CategoryOut( StrCat ) + " Injuries as of " + DateTime.Now.ToString("dd MMM yy") + " Week " + Utility.CurrentWeek() ); h.AddToBody( Header() ); h.AddToBody( InjuryListOut() ); h.AddToBody( Footer() ); h.Render(); }
public void CurrentInjuries() { FileOut = string.Format("{0}Rosters\\{2}\\{3}\\Injuries{1}.htm", Utility.OutputDirectory(), StrCat, Season, CurrentLeague); var h = new HtmlFile(FileOut, Utility.CategoryOut(StrCat) + " Injuries as of " + DateTime.Now.ToString("dd MMM yy") + " Week " + Utility.CurrentWeek()); h.AddToBody(Header()); h.AddToBody(InjuryListOut()); h.AddToBody(Footer()); h.Render(); }
public string RenderHtml() { FileOut = string.Format("{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName); ReportHeader = string.Format("{0} for {1}", ReportType, InstanceName); var reportHeader = string.Format("{0} as of {1}", ReportHeader, DateTime.Now.ToString("dd MMM yy HH:MM tt")); var h = new HtmlFile(FileOut, reportHeader); var html = string.Format("<h3>{0}</h3>", reportHeader); html += string.Format("<pre>{0}</pre>", Body); h.AddToBody(html); h.Render(); return(html); }
public string RenderHtml() { FileOut = string.Format( "{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName ); ReportHeader = string.Format( "{0} for {1}", ReportType, InstanceName ); var reportHeader = string.Format( "{0} as of {1}", ReportHeader, DateTime.Now.ToString( "ddd dd MMM yy HH:MM tt" ) ); var h = new HtmlFile( FileOut, reportHeader ); var html = string.Format( "<h3>{0}</h3>", reportHeader ); html += string.Format( "<pre>{0}</pre>", Body ); h.AddToBody( html ); h.Render(); return html; }
public void PoSnippet(NflTeam t) { FileOut = $"{RootPath(t.Season)}\\PassOff\\PO-{t.TeamCode}.htm"; var h = new HtmlFile( FileOut, $@" {t.NameOut()} Passing Unit as of {DateTime.Now.ToString("dd MMM yy")} Week { Utility.CurrentWeek() }" ); h.AddToBody( HeaderPo(t)); h.AddToBody( t.PoReport()); h.Render(); }
public void SeasonProjection(string metricName, string season, string week, DateTime projectionDate) { #if DEBUG Utility.Announce(string.Format("SeasonProjection metric={0} ...", metricName)); #endif FileOut = ProjectionFileName(metricName, season, week); _html = new HtmlFile(FileOut, " Win Projections as of " + projectionDate.ToString("dd MMM yy")); _html.AddToBody(Header("Season Projections " + metricName + " - " + season)); _html.AddToBody(SeasonOut(metricName, projectionDate)); _html.Render(); ProjectionList.Add(metricName); }
public string CurrentRoster() { FileOut = string.Format( "{0}\\{3}\\Rosters\\{1}\\Roster-{2}-{4}.htm", Utility.OutputDirectory(), CurrentLeague, Focus, Season, Utility.CurrentWeek() ); var h = new HtmlFile( FileOut, Utility.CategoryOut( StrCat ) + " Roster as of " + DateTime.Now.ToString("dd MMM yy") + " Week " + Utility.CurrentWeek() ); h.AddToBody( Header() ); h.AddToBody( TeamListOut() ); h.AddToBody( Footer() ); h.Render(); // copy to a current report (ignoring week) var currentFile = CurrentReportFilename(); h.Render( currentFile ); return currentFile; }
public void Render() { var s = Masters.Sm.GetSeason(Utility.CurrentSeason()); foreach (string teamKey in s.TeamKeyList) { var t = Masters.Tm.GetTeam(teamKey); var fileOut = string.Format("{0}FreeAgents\\FA-{1}.htm", Utility.OutputDirectory(), t.TeamCode); var h = new HtmlFile(fileOut, " Free Agents as of " + DateTime.Now.ToString("dd MMM yy") + " Week " + Utility.CurrentWeek()); h.AddToBody(Header(t)); h.AddToBody(t.FreeAgents(true, true, true)); h.Render(); TeamCount++; #if DEBUG break; #endif } }
public void Render() { var s = Masters.Sm.GetSeason(Utility.CurrentSeason()); foreach (string teamKey in s.TeamKeyList) { var t = Masters.Tm.GetTeam(teamKey); var fileOut = string.Format("{0}FreeAgents\\FA-{1}.htm", Utility.OutputDirectory(), t.TeamCode); var h = new HtmlFile(fileOut, " Free Agents as of " + DateTime.Now.ToString("ddd dd MMM yy") + " Week " + Utility.CurrentWeek()); h.AddToBody(Header(t)); h.AddToBody(t.FreeAgents(true, true, true)); h.Render(); TeamCount++; #if DEBUG break; #endif } }
public string CurrentRoster() { FileOut = string.Format("{0}\\{3}\\Rosters\\{1}\\Roster-{2}-{4}.htm", Utility.OutputDirectory(), CurrentLeague, Focus, Season, Utility.CurrentWeek()); var h = new HtmlFile(FileOut, Utility.CategoryOut(StrCat) + " Roster as of " + DateTime.Now.ToString("dd MMM yy") + " Week " + Utility.CurrentWeek()); h.AddToBody(Header()); h.AddToBody(TeamListOut()); h.AddToBody(Footer()); h.Render(); // copy to a current report (ignoring week) var currentFile = CurrentReportFilename(); h.Render(currentFile); return(currentFile); }
private void RenderMatchup(string s) { if ((_game.HomeNflTeam == null) || (_game.AwayNflTeam == null)) { Utility.Announce("RenderMatchup: null team"); } else { FileOut = string.Format(Utility.OutputDirectory() + "{3}\\Matchups\\Week{2}\\Matchup_Wk{2}_{0}v{1}.htm", _game.HomeNflTeam.TeamCode, _game.AwayNflTeam.TeamCode, _game.Week, _game.Season); var h = new HtmlFile(FileOut, " Matchup as of " + DateTime.Now.ToString("dd MMM yy")); h.AddToBody(s); h.Render(); } }
public void EmptyFileTest() { var testFile = ".\\Output\\test1.html"; var cut = new HtmlFile( testFile,"Test Html File" ); cut.AddTopScript( "src='https://www.gstatic.com/charts/loader.js'" ); cut.AddTopScript( "src='https://www.google.com/jsapi'" ); cut.AddTopScript( "google.charts.load('current', {packages: ['treemap']});" ); var chart = new GoogleChart(); chart.title = "Quick Stats"; chart.width = 250; chart.height = 200; chart.addColumn( "string", "Year" ); chart.addColumn( "number", "Value" ); chart.addColumn( "number", "Profit" ); chart.addRow( "'2014', 2000, 1000" ); var gcText = chart.generateChart( GoogleChart.ChartType.TreeMap ); cut.AddScript( gcText ); cut.Render(); Assert.IsTrue( File.Exists( testFile ) ); }
public string RenderHtml() { FileOut = string.Format("{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName); if (!string.IsNullOrEmpty(InstanceName)) { ReportHeader = string.Format("{0}", InstanceName); } else { ReportHeader = string.Format("{0}", ReportType); } var reportHeader = $@"{ReportHeader} as of { DateTime.Now.ToString( "ddd dd MMM yy HH:MM tt" ) }" ; var h = new HtmlFile(FileOut, reportHeader); var html = string.Format("<h3>{0}</h3>", reportHeader); html += string.Format("<pre>{0}</pre>", Body); h.AddToBody(html); h.Render(); return(html); }
public void TeamUnits( string season, string teamKey ) { var t = Masters.Tm.GetTeam( teamKey ); Utility.Announce( string.Format( "Unit reports for {0}", t.NameOut() ) ); var fileOut = string.Format( "{0}\\{2}\\Units\\{1}-Units.htm", Utility.OutputDirectory(), t.TeamCode, season ); var h = new HtmlFile( fileOut, string.Format( " Unit Reports as of {0} Week {1}", DateTime.Now.ToString( "dd MMM yy" ), Utility.CurrentWeek() ) ); h.AddToBody( Header( t ) ); h.AddToBody( t.UnitReport() ); h.Render(); PoSnippet( t ); #if !DEBUG RoSnippet( t ); PpSnippet( t ); PrSnippet( t ); RdSnippet( t ); PdSnippet( t ); #endif }
/// <summary> /// Express the report in HTML. /// </summary> /// <param name="fileName">The output DOS file fame. Include a directory.</param> /// <param name="persist">Whether to delete the file or not, sometimes we just want the string.</param> public string RenderAsHtml(string fileName, bool persist) { if (ReportHeader == null) ReportHeader = _header; ReportHeader = string.Format("{0} as of {1}", ReportHeader, DateTime.Now.ToString("ddd dd MMM yy HH:MM tt") ); var h = new HtmlFile( fileName, ReportHeader ) {AnnounceIt = AnnounceIt}; AddStyles(h); var html = string.Format("<h3>{0}</h3>", ReportHeader) + Header(_header); if (SubHeader.Length > 0) html += SubHeader; html += BodyOut(); h.AddToBody(html); _et.Stop(DateTime.Now); TimeTaken = _et.TimeOut(); if (!string.IsNullOrEmpty( FootNote )) h.AddToBody(FootNote); h.AddToBody(IsFooter ? ReportFooter : Footer()); if (persist) h.Render(); return html; }
public string Render() { var fileOut = string.Format( "{0}{2}/TeamCards/TeamCard_{1}.htm", Utility.OutputDirectory(), Team.TeamCode, Team.Season ); var h = new HtmlFile(fileOut, "Team Card " + DateTime.Now.ToString("dd MMM yy HH:mm")); h.AddToBody(CardOut()); h.Render(); return fileOut; }
public void RdSnippet(NflTeam t) { FileOut = string.Format("{0}\\RunDef\\RD-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Run Defense Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderRd(t)); h.AddToBody(t.RdReport()); h.Render(); }
public void SeasonProjection(string metricName, string season, string week, DateTime projectionDate) { #if DEBUG Utility.Announce(string.Format("SeasonProjection metric={0} ...", metricName)); #endif FileOut = ProjectionFileName( metricName, season); _html = new HtmlFile(FileOut, " Win Projections as of " + projectionDate.ToString("ddd dd MMM yy")); _html.AddToBody(Header("Season Projections " + metricName + " - " + season)); _html.AddToBody( SeasonOut( metricName, projectionDate)); _html.Render(); ProjectionList.Add( metricName ); Utility.CopySubFile(ProjectionFileName1(metricName, season), ProjectionFileName2(metricName, season, week)); }
public void KickerProjection() { Utility.Announce("Kicker Projections"); FileOut = string.Format("{0}Kickers\\Kickers_{1}.htm", Utility.OutputDirectory(), Utility.CurrentSeason()); _html = new HtmlFile(FileOut, " Kicker Projections as of " + DateTime.Now.ToString("ddd dd MMM yy")); _html.AddToBody(Header("Kicker Projections")); _html.AddToBody(KickersOut()); _html.Render(); }
private void AddStyles(HtmlFile h) { var styleEnumerator = StyleList.GetEnumerator(); while (styleEnumerator.MoveNext()) h.AddStyle(styleEnumerator.Current.ToString()); }
private void RenderMatchup( string s ) { if ( ( _game.HomeNflTeam == null ) || ( _game.AwayNflTeam == null ) ) Utility.Announce( "RenderMatchup: null team" ); else { FileOut = string.Format(Utility.OutputDirectory() + "{3}\\Matchups\\Week{2}\\Matchup_Wk{2}_{0}v{1}.htm", _game.HomeNflTeam.TeamCode, _game.AwayNflTeam.TeamCode, _game.Week, _game.Season ); var h = new HtmlFile( FileOut, " Matchup as of " + DateTime.Now.ToString( "ddd dd MMM yy" ) ); h.AddToBody( s ); h.Render(); } }