9using std::stringstream;
22 const string& caption,
23 const vector<string>& colNames)
const
26 ss <<
"<h2>" << caption <<
"</h2>";
27 ss <<
"<table id=\"efficiency\" >" << endl;
29 for (
size_t i = 0;
i < colNames.size();
i++)
30 ss <<
"<th>" << colNames[
i] <<
"</th>";
31 ss <<
"</tr>" << endl;
42 const string& name)
const
45 ss <<
"<td colspan=\"" << nofCols <<
"\"><center><b>" << name <<
"</b></center></td></tr>" << endl;
50 const vector<string>& row)
const
53 for (
size_t i = 0;
i < row.size();
i++)
54 st +=
"<td>" + row[
i] +
"</td>";
61 const string& file)
const
64 ss <<
"<h3>" << title <<
"</h3>";
65 ss <<
"<img src=\"" << file <<
".png\" alt=\"" << title <<
"\" />";
72 string str =
"<html><body><head><style type=\"text/css\">";
75 str +=
"font-family:Verdana, Arial, Helvetica, sans-serif;";
77 str +=
"border-collapse:collapse;";
79 str +=
"#efficiency td, #efficiency th";
81 str +=
"font-size:1em;";
82 str +=
"border:1px solid #98bf21;";
83 str +=
"padding:3px 7px 2px 7px;";
85 str +=
"#efficiency th";
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;";
94 str +=
"#efficiency tr.alt td";
96 str +=
"color:#000000;";
97 str +=
"background-color:#EAF2D3;";
99 str +=
"</style></head>";
105 return "</body></html>";
110 const string& title)
const
113 ss <<
"<h" << size + 1 <<
">" << title <<
"</h" << size + 1 <<
">";
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.
BmnHtmlReportElement()
Constructor.
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.