📄 htmlcreater.java~1~
字号:
package Utilities;import java.util.*;import Config;import java.io.*;/** * <p>Title: sms_statistics</p> * <p>Description: InHand XMLCenter 短信服务平台计费统计程序</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: 北京映翰通网络技术有限公司</p> * @author 韩传俊 shock2000@21cn.com * @version 1.0 */public class HtmlCreater { String title=""; String option=""; String comment=""; String content=""; String tables=""; public HtmlCreater(String title,String option) { this.title=title; MyDate today=new MyDate(); this.option=option; } public void setTitle(String title){ this.title=title; } public void setOption(String option){ this.option=option; } public void addComment(String comment){ this.comment=comment; } public void addContent(String content){ this.content=content+"<br>"; } public void addTable(HtmlTable table){ this.tables+=table.getHtmlTable()+"<br>"; } public String toString(){ String result="<html>\r\n<head>\r\n<title>"+this.title+"</title>\r\n"; result+="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n"; result+="<style>\r\nBODY { font-size: 10.5pt; LINE-HEIGHT: 14pt;text-decoration: none}\r\n"; result+="TD { font-size: 10.5pt}\r\n</style>\r\n</head>\r\n"; result+="<body>\r\n<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n"; result+="<tr><td align=\"center\" height=\"56\">\r\n"; result+="<p><b><br>"+this.title+"<br></p>"; if (!this.option.equalsIgnoreCase("")) result+="("+this.option+")"; result+="<br></b></td></tr>\r\n"; result+="<tr><td><font color=red>"+this.comment+"</font>\r\n"; result+="</td></tr>\r\n</table>\r\n"; result+=this.tables; result+="<br><b>"+this.content+"</b></body>\r\n</html>\r\n"; return result; } public boolean save(String filename){ try{ String fileName=Config.report_path+filename+".html"; //File file=new File(fileName); FileWriter fo=new FileWriter(Config.report_path+filename+".html",false); BufferedWriter out=new BufferedWriter(fo); out.write(this.toString()); out.close(); fo.close(); Config.mail_fileAffix.add(fileName); return true; }catch(IOException e){ e.printStackTrace(); Config.log.log(e,"while write data to the file named "+filename+".html"); } return false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -