如何使用java poi在excel计算单元中更改文本方向?

时间:2021-09-12 05:06:23

I want to change Text_Direction (not Alignment) of a single cell (not worksheet) on an excel file using java Apache_poi library. how can I do it? thanks.

我想使用java Apache_poi库更改excel文件上单个单元格(不是工作表)的Text_Direction(不是对齐)。我该怎么做呢?谢谢。

1 个解决方案

#1


1  

after looking a lot I found another way that will fix the problem. As explained here , it's just needed to change the direction of the text that will be placed in the cell. the solution will be like below for right to left:

在看了很多之后,我找到了另一种解决问题的方法。正如这里所解释的,只需更改将放置在单元格中的文本的方向。从右到左的解如下:

String rtl = "\u200F" + otherTexts;

and like this for LTR:

像这样对LTR:

String left2right_text = "\u200E" + otherTexts;

#1


1  

after looking a lot I found another way that will fix the problem. As explained here , it's just needed to change the direction of the text that will be placed in the cell. the solution will be like below for right to left:

在看了很多之后,我找到了另一种解决问题的方法。正如这里所解释的,只需更改将放置在单元格中的文本的方向。从右到左的解如下:

String rtl = "\u200F" + otherTexts;

and like this for LTR:

像这样对LTR:

String left2right_text = "\u200E" + otherTexts;