LODOP 打印excle 格式html方法

2023-10-12 10:59

本文主要是介绍LODOP 打印excle 格式html方法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、准备要打印的excel

在这里插入图片描述

2、将其另存为html文件

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

3、截取html文件源代码

<style>
tr{mso-height-source:auto;mso-ruby-visibility:none;}
col{mso-width-source:auto;mso-ruby-visibility:none;}
br{mso-data-placement:same-cell;}
ruby{ruby-align:left;}
.style0{mso-number-format:General;text-align:general;vertical-align:middle;white-space:nowrap;mso-rotate:0;mso-background-source:auto;mso-pattern:auto;color:windowtext;font-size:12.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;border:none;mso-style-name:常规;mso-style-id:0;}
td{mso-style-parent:style0;padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:12.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;border:none;mso-background-source:auto;mso-pattern:auto;mso-protection:locked visible;white-space:nowrap;mso-rotate:0;}
.xl65{mso-style-parent:style0;text-align:center;}
.xl66{mso-style-parent:style0;text-align:center;border:.5pt solid windowtext;}
.xl67{mso-style-parent:style0;border:.5pt solid windowtext;}
.xl68{mso-style-parent:style0;font-size:14.0pt;font-family:方正仿宋_GBK;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:"\@";text-align:center;border:.5pt solid windowtext;background:#D8D8D8;mso-pattern:black none;}
.xl69{mso-style-parent:style0;color:black;font-size:14.0pt;font-family:方正仿宋_GBK;mso-generic-font-family:auto;mso-font-charset:134;text-align:center;border:.5pt solid windowtext;background:#D8D8D8;mso-pattern:black none;white-space:normal;}
.xl70{mso-style-parent:style0;border:.5pt solid windowtext;background:#D8D8D8;mso-pattern:black none;}
.xl71{mso-style-parent:style0;text-align:center;border:.5pt solid windowtext;background:#D8D8D8;mso-pattern:black none;}
.xl72{mso-style-parent:style0;mso-number-format:"yyyy\0022年\0022m\0022月\0022";border:.5pt solid windowtext;}
.xl73{mso-style-parent:style0;font-weight:700;mso-number-format:"yyyy\0022年\0022m\0022月\0022";border:.5pt solid windowtext;}
.xl74{mso-style-parent:style0;border:.5pt solid windowtext;white-space:normal;}
.xl75{mso-style-parent:style0;font-weight:700;vertical-align:bottom;}
.xl76{mso-style-parent:style0;mso-number-format:"\@";text-align:center;border:.5pt solid windowtext;}
.xl77{mso-style-parent:style0;text-align:center;border:.5pt solid windowtext;white-space:normal;}
.xl78{mso-style-parent:style0;font-weight:700;border:.5pt solid windowtext;}
.xl79{mso-style-parent:style0;font-size:16.0pt;font-weight:700;text-align:center;border-top:none;border-right:none;border-bottom:.5pt solid windowtext;border-left:none;}</style>
<table border=0 cellpadding=0 cellspacing=0 width=1020 style='border-collapse:collapse;table-layout:fixed;width:766pt'><col width=40 style='mso-width-source:userset;mso-width-alt:1280;width:30pt'><col width=106 style='mso-width-source:userset;mso-width-alt:3392;width:80pt'><col width=67 style='mso-width-source:userset;mso-width-alt:2144;width:50pt'><col width=94 style='mso-width-source:userset;mso-width-alt:3008;width:71pt'><col width=44 style='mso-width-source:userset;mso-width-alt:1408;width:33pt'><col width=62 style='mso-width-source:userset;mso-width-alt:1984;width:47pt'><col width=99 style='mso-width-source:userset;mso-width-alt:3168;width:74pt'><col width=235 style='mso-width-source:userset;mso-width-alt:7520;width:176pt'><col width=161 style='mso-width-source:userset;mso-width-alt:5152;width:121pt'><col width=112 style='mso-width-source:userset;mso-width-alt:3584;width:84pt'><col width=404 style='mso-width-source:userset;mso-width-alt:12928;width:303pt'><tr height=50 style='mso-height-source:userset;height:37.7pt'><td colspan=8 height=50 class=xl79 width=747 style='height:37.7pt;width:561pt'>****年**月表</td><td width=161 style='width:121pt'></td><td width=112 style='width:84pt'></td></tr><tr class=xl65 height=44 style='mso-height-source:userset;height:33.0pt'><td height=44 class=xl66 style='height:33.0pt;border-top:none'>序号</td><td class=xl76 style='border-top:none;border-left:none'>a</td><td class=xl76 style='border-top:none;border-left:none'>b</td><td class=xl66 style='border-top:none;border-left:none'>c</td><td class=xl77 width=44 style='border-top:none;border-left:none;width:33pt'>d</td><td class=xl77 width=62 style='border-top:none;border-left:none;width:47pt'>e</td><td class=xl66 style='border-top:none;border-left:none'>f</td><td class=xl77 width=235 style='border-top:none;border-left:none;width:176pt'>g</td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td colspan=8 height=28 class=xl78 style='height:21.0pt'>一、a类人员</td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>1</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>2</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>3</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65><span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>4</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>5</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td colspan=8 height=28 class=xl78 style='height:21.0pt'>二、b类人员</td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=32 style='mso-height-source:userset;height:24.0pt'><td height=32 class=xl67 align=right style='height:24.0pt;border-top:none'>1</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl72 style='border-top:none;border-left:none'> </td><td class=xl67 style='border-top:none;border-left:none'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=34 style='mso-height-source:userset;height:25.7pt'><td height=34 class=xl67 align=right style='height:25.7pt;border-top:none'>2</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl73 style='border-top:none;border-left:none'> </td><td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=36 style='mso-height-source:userset;height:27.0pt'><td height=36 class=xl67 align=right style='height:27.0pt;border-top:none'>3</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl73 style='border-top:none;border-left:none'> </td><td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=36 style='mso-height-source:userset;height:27.0pt'><td height=36 class=xl67 align=right style='height:27.0pt;border-top:none'>4</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td><td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl73 style='border-top:none;border-left:none'> </td><td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td><td class=xl65></td><td class=xl65></td></tr><tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'><td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>5</td><td class=xl68 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl70 style='border-top:none;border-left:none'> </td><td class=xl71 style='border-top:none;border-left:none'> </td><td class=xl73 style='border-top:none;border-left:none'> </td><td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td><td class=xl65></td><td class=xl65></td></tr><tr height=49 style='mso-height-source:userset;height:36.75pt'><td height=49 class=xl75 colspan=2 style='height:36.75pt;mso-ignore:colspan'>填表人:<spanstyle='mso-spacerun:yes'>&nbsp;</span></td><td class=xl75></td><td class=xl75>复核:<span style='mso-spacerun:yes'>&nbsp;</span></td><td class=xl75></td><td class=xl75></td><td class=xl75 colspan=2 style='mso-ignore:colspan'>领导审核:<spanstyle='mso-spacerun:yes'>&nbsp;</span></td><td></td><td></td></tr><![if supportMisalignedColumns]><tr height=0 style='display:none'><td width=40 style='width:30pt'></td><td width=106 style='width:80pt'></td><td width=67 style='width:50pt'></td><td width=94 style='width:71pt'></td><td width=44 style='width:33pt'></td><td width=62 style='width:47pt'></td><td width=99 style='width:74pt'></td><td width=235 style='width:176pt'></td><td width=161 style='width:121pt'></td><td width=112 style='width:84pt'></td></tr><![endif]>
</table>

4、将截取到的代码用于打印

该方法省去了手动画表格的步骤

这篇关于LODOP 打印excle 格式html方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/195384

相关文章

504 Gateway Timeout网关超时的根源及完美解决方法

《504GatewayTimeout网关超时的根源及完美解决方法》在日常开发和运维过程中,504GatewayTimeout错误是常见的网络问题之一,尤其是在使用反向代理(如Nginx)或... 目录引言为什么会出现 504 错误?1. 探索 504 Gateway Timeout 错误的根源 1.1 后端

MySQL 表空却 ibd 文件过大的问题及解决方法

《MySQL表空却ibd文件过大的问题及解决方法》本文给大家介绍MySQL表空却ibd文件过大的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考... 目录一、问题背景:表空却 “吃满” 磁盘的怪事二、问题复现:一步步编程还原异常场景1. 准备测试源表与数据

python 线程池顺序执行的方法实现

《python线程池顺序执行的方法实现》在Python中,线程池默认是并发执行任务的,但若需要实现任务的顺序执行,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋... 目录方案一:强制单线程(伪顺序执行)方案二:按提交顺序获取结果方案三:任务间依赖控制方案四:队列顺序消

SpringBoot通过main方法启动web项目实践

《SpringBoot通过main方法启动web项目实践》SpringBoot通过SpringApplication.run()启动Web项目,自动推断应用类型,加载初始化器与监听器,配置Spring... 目录1. 启动入口:SpringApplication.run()2. SpringApplicat

使用Java读取本地文件并转换为MultipartFile对象的方法

《使用Java读取本地文件并转换为MultipartFile对象的方法》在许多JavaWeb应用中,我们经常会遇到将本地文件上传至服务器或其他系统的需求,在这种场景下,MultipartFile对象非... 目录1. 基本需求2. 自定义 MultipartFile 类3. 实现代码4. 代码解析5. 自定

Python文本相似度计算的方法大全

《Python文本相似度计算的方法大全》文本相似度是指两个文本在内容、结构或语义上的相近程度,通常用0到1之间的数值表示,0表示完全不同,1表示完全相同,本文将深入解析多种文本相似度计算方法,帮助您选... 目录前言什么是文本相似度?1. Levenshtein 距离(编辑距离)核心公式实现示例2. Jac

C#高效实现Word文档内容查找与替换的6种方法

《C#高效实现Word文档内容查找与替换的6种方法》在日常文档处理工作中,尤其是面对大型Word文档时,手动查找、替换文本往往既耗时又容易出错,本文整理了C#查找与替换Word内容的6种方法,大家可以... 目录环境准备方法一:查找文本并替换为新文本方法二:使用正则表达式查找并替换文本方法三:将文本替换为图

SQL Server 查询数据库及数据文件大小的方法

《SQLServer查询数据库及数据文件大小的方法》文章介绍了查询数据库大小的SQL方法及存储过程实现,涵盖当前数据库、所有数据库的总大小及文件明细,本文结合实例代码给大家介绍的非常详细,感兴趣的... 目录1. 直接使用SQL1.1 查询当前数据库大小1.2 查询所有数据库的大小1.3 查询每个数据库的详

Java实现本地缓存的四种方法实现与对比

《Java实现本地缓存的四种方法实现与对比》本地缓存的优点就是速度非常快,没有网络消耗,本地缓存比如caffine,guavacache这些都是比较常用的,下面我们来看看这四种缓存的具体实现吧... 目录1、HashMap2、Guava Cache3、Caffeine4、Encache本地缓存比如 caff

Java 中编码与解码的具体实现方法

《Java中编码与解码的具体实现方法》在Java中,字符编码与解码是处理数据的重要组成部分,正确的编码和解码可以确保字符数据在存储、传输、读取时不会出现乱码,本文将详细介绍Java中字符编码与解码的... 目录Java 中编码与解码的实现详解1. 什么是字符编码与解码?1.1 字符编码(Encoding)1