如何将POI数据高效生成Word文档?

摘要:通过配置word模板生成相应的word文档。支持文字,列表,原样式输出。采用java poi 开源库。
p, blockquote, ul, ol, dl, table, pre { margin: 15px 0 } h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased } h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { font-size: inherit } h1 { font-size: 28px; color: rgba(0, 0, 0, 1) } h2 { font-size: 24px; border-bottom: 1px solid rgba(204, 204, 204, 1); color: rgba(0, 0, 0, 1) } h3 { font-size: 18px } h4 { font-size: 16px } h5 { font-size: 14px } h6 { color: rgba(119, 119, 119, 1); font-size: 14px } body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child { margin-top: 0; padding-top: 0 } a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0; padding-top: 0 } h1+p, h2+p, h3+p, h4+p, h5+p, h6+p { margin-top: 10px } a { color: rgba(65, 131, 196, 1); text-decoration: none } a:hover { text-decoration: underline } ul, ol { padding-left: 30px } ul li>:first-child, ol li>:first-child, ul li ul:first-of-type, ol li ol:first-of-type, ul li ol:first-of-type, ol li ul:first-of-type { margin-top: 0 } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0 } dl { padding: 0 } dl dt { font-size: 14px; font-weight: bold; font-style: italic; padding: 0; margin: 15px 0 5px } dl dt:first-child { padding: 0 } dl dt>:first-child { margin-top: 0 } dl dt>:last-child { margin-bottom: 0 } dl dd { margin: 0 0 15px; padding: 0 15px } dl dd>:first-child { margin-top: 0 } dl dd>:last-child { margin-bottom: 0 } pre, code, tt { font-size: 12px; font-family: Consolas, "Liberation Mono", Courier, monospace } code, tt { margin: 0; padding: 0; white-space: nowrap; border: 1px solid rgba(234, 234, 234, 1); background-color: rgba(248, 248, 248, 1); border-radius: 3px } pre>code { margin: 0; padding: 0; white-space: pre; border: none; background: rgba(0, 0, 0, 0) } pre { background-color: rgba(248, 248
阅读全文