Hi In Tools->Options->International (OfficeXP) or View (Earlier Office versions) There is an option to view current sheet right to left. It means that columns will be shown : ..DBCA instead of the usual ABCD.. When I recorded the action as a Macro I got the following : Sub Macro1() ' ' Macro1 Macro ' Macro recorded 01/02/2004 by Administrator ' ' Keyboard Shortcut: Ctrl+q ' ActiveSheet.DisplayRightToLeft = True End Sub Is there a way in HSSF to do it using HSSFSheet or something like that ? Thanks.
IIRC, There is some stuff at the low level for this, but no high level API was exposed. I just recall seing it in the records and stuff.
Hi, Sorry but what is RFE ? and IIRC ? When Are you planning to enter high level API for this method ? Next version or patch ? Thanks.
Hi, I looked into the files and found out that on WindowTwoRecord there is a method called setArabic(boolean) which supposed to do the DisplayRightToLeft as it is described in excelfileformat.pdf (page 184) which is to set option's bit 6 (0.0040H) to true or false. Problem is : How can I reach from HSSFSheet the WindowTwoRecord ? I saw that getSheet() is protected so I can't use the getRecordBySid method. How can I reach the getSheet() method ? I see that you do it in HSSFWorkbook so I don't know how it compiles as it is protected. A future feature for next version might be to add a method setDisplayRightToLeft(boolean isRightToLeft) to HSSFSheet which does : WindowTwoRecord windowTwo = (WindowTwoRecord) sheet.getSheet ().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setArabic(isRightToLeft);
Hi Some Additional Comments. I understand you want me to enter a high level support of setDisplayRightToLeft to the CVS. Since I have slow connection it will take me ages to download all the ANT+all BUILD and CVS files, and I do not know your policy regarding renaming a method. so I ask of you to do the following if you can : 1. Add a method in class HSSFSheet.java { public void setDisplayRightToLeft(boolean isRightToLeft) { WindowTwoRecord windowTwo = (WindowTwoRecord) getSheet().findFirstRecordBySid (WindowTwoRecord.sid); windowTwo.setArabic(isRightToLeft); } 2. Maybe you can change the method name WindowTwoRecord::setArabic since it also applies to Hebrew. The method does setDisplayRightToLeft and I think should be called like that in WindowTwoRecord. Thanks.
HSSFSHeet.setRightToLeft(boolean value) was added in POI 3.6. Yegor