medie
= " <table width=680><tbody><tr bgcolor=\"lightGray\" ><td colspan=3 >"+ QObject::tr("Valori medi mensili") +"</td></tr>";
medie +="<tr><td colspan=3>";
medie +="<table width=100% border=1 cellspacing=0 cellpadding=3 ><tr><td></td>";
medie
+= "<td>" + QObject::tr("Energia[")+unitEnergy
+"]" + "</td>";
medie
+= "<td>" + QObject::tr("Fattore Ombre[%]") + "</td>";
medie
+= "<td>" + QObject::tr("Perdite termiche[%]") + "</td>";
medie
+= "<td>" + QObject::tr("Altre perdite[%]") + "</td>";
medie
+= "<td>" + QObject::tr("Temp. medie[<sup>o</sup>]") + "</td>";
medie
+= "<td>" + QObject::tr("Vento medio[m/s]") + "</td>";
medie += "</tr>";
for(int i=0;i<12;i++) {
medie += "<tr>";
medie += "<td>" + MyMath::months(i+1) + "</td>";
if (Eset)
medie
+= "<td>" + QString("%L1").
arg(E
[i
],
0,
'f',
2) + "</td>";
else
medie
+= "<td>" + QString("%L1").
arg(0) + "</td>";
medie
+= "<td>" + QString("%L1").
arg((opt.
shadows.
at(i
))*100,
0,
'f',
2) + "</td>";
medie
+= "<td>" +QString("%L1").
arg((1- opt.thermalLosses.at(i))*100,0,'f',2) +"</td>";
medie
+= "<td>" + QString("%L1").
arg((opt.
otherLoss.
at(i
))*100,
0,
'f',
2) +"</td>";
medie
+= "<td>" + QString("%L1").
arg(opt.
temperatures.
at(i
),
0,
'f',
2) +"</td>";
medie
+= "<td>" +QString("%L1").
arg(opt.
wind.
at(i
),
0,
'f',
2) + "</td>";
medie += "</tr>";
}
medie += "</table>";
medie += "</td></tr></tbody></table>";
medie = " <table width=680><tbody><tr bgcolor=\"lightGray\" ><td colspan=3 >"+ QObject::tr("Valori medi mensili") +"</td></tr>";
medie +="<tr><td colspan=3>";
medie +="<table width=100% border=1 cellspacing=0 cellpadding=3 ><tr><td></td>";
medie += "<td>" + QObject::tr("Energia[")+unitEnergy+"]" + "</td>";
medie += "<td>" + QObject::tr("Fattore Ombre[%]") + "</td>";
medie += "<td>" + QObject::tr("Perdite termiche[%]") + "</td>";
medie += "<td>" + QObject::tr("Altre perdite[%]") + "</td>";
medie += "<td>" + QObject::tr("Temp. medie[<sup>o</sup>]") + "</td>";
medie += "<td>" + QObject::tr("Vento medio[m/s]") + "</td>";
medie += "</tr>";
for(int i=0;i<12;i++) {
medie += "<tr>";
medie += "<td>" + MyMath::months(i+1) + "</td>";
if (Eset)
medie += "<td>" + QString("%L1").arg(E[i],0,'f',2) + "</td>";
else
medie += "<td>" + QString("%L1").arg(0) + "</td>";
medie += "<td>" + QString("%L1").arg((opt.shadows.at(i))*100,0,'f',2) + "</td>";
medie += "<td>" +QString("%L1").arg((1-
opt.thermalLosses.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg((opt.otherLoss.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg(opt.temperatures.at(i),0,'f',2) +"</td>";
medie += "<td>" +QString("%L1").arg(opt.wind.at(i),0,'f',2) + "</td>";
medie += "</tr>";
}
medie += "</table>";
medie += "</td></tr></tbody></table>";
To copy to clipboard, switch view to plain text mode
And I print on a qprinter by using
m_cursor.insertHtml(medie);
m_document->drawContents(&p,printer->paperRect());
m_cursor.insertHtml(medie);
m_document->drawContents(&p,printer->paperRect());
To copy to clipboard, switch view to plain text mode
But the result is a broken table
Bookmarks