poi HSSFRichTextString 对cell中的每一段文字设置字体
HSSFRichTextString ts= new HSSFRichTextString(" 经审核,我司已同意其出库申请。请你部按规定将托管银行承兑汇票办理出库。" +
"我公司指派___________________(身份证号:_____________________________________)" +
"、___________________(身份证号:_____________________________________)" +
"和___________________(身份证号:_____________________________________)" +
"持本通知书办理提票事项,并请你部将出库票据移交_________________和_________________两人签收。");
________ 在宋体格式下显示为_ _ ,所以将"___"字体设置为Arial,将文字字体设置为宋体
HSSFFont font = xls.createFont();
font.setFontHeightInPoints((short)10); // 设置字体大小
font.setFontName("宋体");
ts.applyFont(0, 45, font);
ts.applyFont(64, 70, font);
ts.applyFont(107, 109, font);
ts.applyFont(128, 134, font);
ts.applyFont(171, 173, font);
ts.applyFont(193, 198, font);
ts.applyFont(235, 258, font);
ts.applyFont(275, 275, font);
ts.applyFont(294, 299, font);
HSSFFont font1 = xls.createFont();
font1.setFontHeightInPoints((short)10); // 设置字体大小
font1.setFontName("Arial");
ts.applyFont(45, 64, font1);
ts.applyFont(70, 107, font1);
ts.applyFont(109, 128, font1);
ts.applyFont(134, 171, font1);
ts.applyFont(173, 192, font1);
ts.applyFont(198, 235, font1);
ts.applyFont(258, 275, font1);
ts.applyFont(276, 294, font1);
cell.setCellValue(ts);
poi HSSFRichTextString 对cell中的每一段文字设置字体的更多相关文章
- 开题报告中如何将一段文字插入到word表格中
1,举例如下,打开空白word,设计一个20列的表格.任意一段文字. 2,选中这段文字,点击替换按钮.查找内容为“?”,替换为“^&,”(后面是逗号),并勾选“使用通配符”. 3,全部替换得到 ...
- 在HTML中如何隐藏某段文字具体该怎么实现
<p style="display:none;"> 需要隐藏的文字....... </p> <div style="display:none ...
- 设置input中placeholder的样式(placeholder设置字体)
方法: 代码示例: .input::-webkit-input-placeholder { font-size: 3.73333333vw; color: #cccccc; } .input:-moz ...
- 在Excel表格中输入一大段文字
1.有时为了注释的需要,在excel中需要输入一大段文字,这时候可以使用—视图-工具-绘图,然后选择下面的文本框,即可自定义文本框大小,如需要文本框和表格边框完全重合,在鼠标画文本框时按住 Alt键.
- 【POI】使用POI处理xlsx的cell中的超链接 和 插入图片 和 设置打印区域
使用POI对xlsx中插入超链接和 插入图片 package com.it.poiTest; import java.awt.image.BufferedImage; import java.io.B ...
- SpringMVC 实现POI读取Excle文件中数据导入数据库(上传)、导出数据库中数据到Excle文件中(下载)
读取Excale表返回一个集合: package com.shiliu.game.utils; import java.io.File; import java.io.FileInputStream; ...
- java用poi读取Excel表格中的数据
Java读写Excel的包是Apache POI(项目地址:http://poi.apache.org/),因此需要先获取POI的jar包,本实验使用的是POI 3.9稳定版.Apache POI 代 ...
- POI往word模板中写入数据
转: POI往word模板中写入数据 2018年03月24日 16:00:22 乄阿斗同學 阅读数:2977 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn ...
- 使用poi读取word2007(.docx)中的复杂表格
使用poi读取word2007(.docx)中的复杂表格 最近工作需要做一个读取word(.docx)中的表格,并以html形式输出.经过上网查询,使用了poi. 对于2007及之后的word文档,需 ...
随机推荐
- 1、Spark 通过api,hfile两种形式获取hbase数据,简单样例
pom内容: <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-se ...
- tomcat重启或关闭后,上传文件消失 .
tomcat重启或关闭后,上传文件消失的问题,是因为在断电前myeclipse是启动的,断电时造成myeclipse异常关闭,再重新启动myeclipse时会重新发布项目,把先前发布的项目给覆盖了,所 ...
- Modified Kaprekar Numbers
Link: https://www.hackerrank.com/challenges/kaprekar-numbers from __future__ import print_function d ...
- Project Euler #80: Square root digital expansion
from decimal import getcontext, Decimal def main(): n = int(raw_input()) p = int(raw_input()) getcon ...
- UVa 232 Crossword Answers
Crossword Answers A crossword puzzle consists of a rectangular grid of black and white squares and ...
- Codeforces 366C Dima and Salad
http://codeforces.com/problemset/problem/366/C 题意:在一个冰箱里有n种水果,并且这些水果每一种都有一个美味度和一个卡路里的属性, 小明要从这些水果中选出 ...
- HTTP 错误 500.21 - Internal Server Error 处理程序“PageHandlerFactory-ISAPI-4.0_32bit”在其模块
问题: 系统是win7.今天把我做过的项目发布后,在IIS上运行时一直出现一个错误,HTTP 错误500.21-Internal Server Error.处理程序“PageHandlerFactor ...
- Linux上的设备管理器
一般windows上我们用它自带的“设备管理器”来查看,管理,安装,卸载驱动. 那么问题来了,Linux上用什么命令来看呢? 可以用: lshw lsusb lspci lsmod 查看特定模块. ...
- The Most Wanted Letter
The Most Wanted Letter You are given a text, which contains different english letters and punctuatio ...
- 【HDU 4612 Warm up】BCC 树的直径
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4612 题意:一个包含n个节点m条边的无向连通图(无自环,可能有重边).求添加一条边后最少剩余的桥的数 ...