Apache poi Excel installed the reader from right to left

I am having problems formatting a cell with Apache pois 3.9 correctly. I got some English and some Arabic text in my table, so I need to set the reader from right to left for some cells using

ExtendedFormatRecord.setReadingOrder(2); doc

HSSFCellStyle is created using

HSSFCellStyle(short index, ExtendedFormatRecord rec, HSSFWorkbook workbook) shown here

The problem is that the constructor is protected and the class is final. Therefore, I cannot extend it. Is it possible to install a reader from right to left for one cell? I do not need to set the table style in rtl. Also, this does not solve the problem.

+4
source share
2 answers

.

Constructor<HSSFCellStyle> con = HSSFCellStyle.class.getDeclaredConstructor(short.class,
    ExtendedFormatRecord.class, HSSFWorkbook.class);

con.setAccessible(true);

ExtendedFormatRecord eFR = new ExtendedFormatRecord();
short ro = 2;
eFR.setReadingOrder(ro);

short s = 0;
HSSFWorkbook generatedWb = new HSSFWorkbook();
HSSFCellStyle myStyle = con.newInstance(s, eFR, generatedWb);
0

Apache POI!

( 3.11 beta 3/3.11 final) HSSFCellStyle.setReadingOrder(),

0

All Articles