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方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:https://blog.csdn.net/qq_39173779/article/details/120053849
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/195384

相关文章

使用Python实现调用API获取图片存储到本地的方法

《使用Python实现调用API获取图片存储到本地的方法》开发一个自动化工具,用于从JSON数据源中提取图像ID,通过调用指定API获取未经压缩的原始图像文件,并确保下载结果与Postman等工具直接... 目录使用python实现调用API获取图片存储到本地1、项目概述2、核心功能3、环境准备4、代码实现

8种快速易用的Python Matplotlib数据可视化方法汇总(附源码)

《8种快速易用的PythonMatplotlib数据可视化方法汇总(附源码)》你是否曾经面对一堆复杂的数据,却不知道如何让它们变得直观易懂?别慌,Python的Matplotlib库是你数据可视化的... 目录引言1. 折线图(Line Plot)——趋势分析2. 柱状图(Bar Chart)——对比分析3

Nginx 413修改上传文件大小限制的方法详解

《Nginx413修改上传文件大小限制的方法详解》在使用Nginx作为Web服务器时,有时会遇到客户端尝试上传大文件时返回​​413RequestEntityTooLarge​​... 目录1. 理解 ​​413 Request Entity Too Large​​ 错误2. 修改 Nginx 配置2.1

使用@Cacheable注解Redis时Redis宕机或其他原因连不上继续调用原方法的解决方案

《使用@Cacheable注解Redis时Redis宕机或其他原因连不上继续调用原方法的解决方案》在SpringBoot应用中,我们经常使用​​@Cacheable​​注解来缓存数据,以提高应用的性能... 目录@Cacheable注解Redis时,Redis宕机或其他原因连不上,继续调用原方法的解决方案1

CSS 样式表的四种应用方式及css注释的应用小结

《CSS样式表的四种应用方式及css注释的应用小结》:本文主要介绍了CSS样式表的四种应用方式及css注释的应用小结,本文通过实例代码给大家介绍的非常详细,详细内容请阅读本文,希望能对你有所帮助... 一、外部 css(推荐方式)定义:将 CSS 代码保存为独立的 .css 文件,通过 <link> 标签

sql语句字段截取方法

《sql语句字段截取方法》在MySQL中,使用SUBSTRING函数可以实现字段截取,下面给大家分享sql语句字段截取方法,感兴趣的朋友一起看看吧... 目录sql语句字段截取sql 截取表中指定字段sql语句字段截取1、在mysql中,使用SUBSTRING函数可以实现字段截取。例如,要截取一个字符串字

JAVA数组中五种常见排序方法整理汇总

《JAVA数组中五种常见排序方法整理汇总》本文给大家分享五种常用的Java数组排序方法整理,每种方法结合示例代码给大家介绍的非常详细,感兴趣的朋友跟随小编一起看看吧... 目录前言:法一:Arrays.sort()法二:冒泡排序法三:选择排序法四:反转排序法五:直接插入排序前言:几种常用的Java数组排序

Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题

《Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题》:本文主要介绍Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未... 目录一、前言二、系统架构检测三、卸载旧版 Go四、下载并安装正确版本五、配置环境变量六、验证安装七、常见

Python将字符串转换为小写字母的几种常用方法

《Python将字符串转换为小写字母的几种常用方法》:本文主要介绍Python中将字符串大写字母转小写的四种方法:lower()方法简洁高效,手动ASCII转换灵活可控,str.translate... 目录一、使用内置方法 lower()(最简单)二、手动遍历 + ASCII 码转换三、使用 str.tr

Python处理超大规模数据的4大方法详解

《Python处理超大规模数据的4大方法详解》在数据的奇妙世界里,数据量就像滚雪球一样,越变越大,从最初的GB级别的小数据堆,逐渐演变成TB级别的数据大山,所以本文我们就来看看Python处理... 目录1. Mars:数据处理界的 “变形金刚”2. Dask:分布式计算的 “指挥家”3. CuPy:GPU