未验证 提交 88a0e920 编写于 作者: S Serge Rider 提交者: GitHub

Merge pull request #6483 from Arty68/devel

Update DataExporterHTML.java
......@@ -43,6 +43,7 @@ import java.util.List;
*/
public class DataExporterHTML extends StreamExporterAbstract {
private String name;
private static final int IMAGE_FRAME_SIZE = 200;
private List<DBDAttributeBinding> columns;
......@@ -63,24 +64,39 @@ public class DataExporterHTML extends StreamExporterAbstract {
@Override
public void exportHeader(DBCSession session) throws DBException, IOException
{
columns = getSite().getAttributes();
name = getSite().getSource().getName();
columns = getSite().getAttributes();
printHeader();
}
private void printHeader()
{
PrintWriter out = getWriter();
out.write("<html>");
out.write("\t<head>" +
"\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">" +
"\n\t<style>" +
"table {font-family:\"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;font-size:12px;text-align:left;border-collapse:collapse;margin:10px;} " +
"th{font-size:14px;font-weight:normal;color:#039;padding:10px 8px;} " +
"td{color:#669;padding:8px;}" +
".odd{background:#e8edff;}" +
"img{padding:5px; border:solid; border-color: #dddddd #aaaaaa #aaaaaa #dddddd; border-width: 1px 2px 2px 1px; background-color:white;}" +
"</style>\n</head>");
out.write("<body><table>\n");
out.write("<html>");
out.write("<head><style>" +
"table {border: medium solid #6495ed;" +
"border-collapse: collapse;" +
"width: 50%;} " +
"th{font-family: monospace;" +
"border: thin solid #6495ed;" +
"width: 50%;" +
"padding: 5px;" +
"background-color: #D0E3FA;"+
"background-image: url(sky.jpg);}" +
"td{font-family: sans-serif;" +
"border: thin solid #6495ed;" +
"width: 50%;" +
"padding: 5px;" +
"text-align: center;" +
"background-color: #ffffff;}" +
".odd{background:#e8edff;}" +
"img{padding:5px; border:solid; border-color: #dddddd #aaaaaa #aaaaaa #dddddd; border-width: 1px 2px 2px 1px; background-color:white;}" +
"</style></head>");
out.write("<body><table>");
out.write("<tr>");
writeTextCell(name, true);
out.write("</tr>");
out.write("<tr>");
for (int i = 0, columnsSize = columns.size(); i < columnsSize; i++) {
String colName = columns.get(i).getLabel();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册