BmnRoot
Loading...
Searching...
No Matches
BmnHtmlReportElement.cxx
Go to the documentation of this file.
1
7#include <sstream>
8
9using std::stringstream;
10using std::endl;
11
15
20
22 const string& caption,
23 const vector<string>& colNames) const
24{
25 stringstream ss;
26 ss << "<h2>" << caption << "</h2>";
27 ss << "<table id=\"efficiency\" >" << endl;
28 ss << "<tr>";
29 for (size_t i = 0; i < colNames.size(); i++)
30 ss << "<th>" << colNames[i] << "</th>";
31 ss << "</tr>" << endl;
32 return ss.str();
33}
34
36{
37 return "</table>";
38}
39
41 int nofCols,
42 const string& name) const
43{
44 stringstream ss;
45 ss << "<td colspan=\"" << nofCols << "\"><center><b>" << name << "</b></center></td></tr>" << endl;
46 return ss.str();
47}
48
50 const vector<string>& row) const
51{
52 string st = "<tr>";
53 for (size_t i = 0; i < row.size(); i++)
54 st += "<td>" + row[i] + "</td>";
55 st += "</tr> \n";
56 return st;
57}
58
60 const string& title,
61 const string& file) const
62{
63 stringstream ss;
64 ss << "<h3>" << title << "</h3>";
65 ss << "<img src=\"" << file << ".png\" alt=\"" << title << "\" />";
66
67 return ss.str();
68}
69
71{
72 string str = "<html><body><head><style type=\"text/css\">";
73 str += "#efficiency";
74 str += "{";
75 str += "font-family:Verdana, Arial, Helvetica, sans-serif;";
76// str += "width:100%;";
77 str += "border-collapse:collapse;";
78 str += "}";
79 str += "#efficiency td, #efficiency th";
80 str += "{";
81 str += "font-size:1em;";
82 str += "border:1px solid #98bf21;";
83 str += "padding:3px 7px 2px 7px;";
84 str += "}";
85 str += "#efficiency th";
86 str += "{";
87 str += "font-size:1.1em;";
88 str += "text-align:left;";
89 str += "padding-top:5px;";
90 str += "padding-bottom:4px;";
91 str += "background-color:#A7C942;";
92 str += "color:#ffffff;";
93 str += "}";
94 str += "#efficiency tr.alt td";
95 str += "{";
96 str += "color:#000000;";
97 str += "background-color:#EAF2D3;";
98 str += "}";
99 str += "</style></head>";
100 return str;
101}
102
104{
105 return "</body></html>";
106}
107
109 int size,
110 const string& title) const
111{
112 stringstream ss;
113 ss << "<h" << size + 1 << ">" << title << "</h" << size + 1 << ">";
114 return ss.str();
115}
int i
Definition P4_F32vec4.h:22
Implementation of BmnReportElement for HTML output.
virtual string DocumentEnd() const
Inherited from BmnReportElement.
virtual string TableEmptyRow(int nofCols, const string &name) const
Inherited from BmnReportElement.
virtual ~BmnHtmlReportElement()
Destructor.
virtual string Image(const string &title, const string &file) const
Inherited from BmnReportElement.
virtual string TableBegin(const string &caption, const vector< string > &colNames) const
Inherited from BmnReportElement.
virtual string TableEnd() const
Inherited from BmnReportElement.
virtual string Title(int size, const string &title) const
Inherited from BmnReportElement.
virtual string DocumentBegin() const
Inherited from BmnReportElement.
virtual string TableRow(const vector< string > &row) const
Inherited from BmnReportElement.