Bug 26574 - [RFE] ActiveSheet.DisplayRightToLeft = True
Summary: [RFE] ActiveSheet.DisplayRightToLeft = True
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2004-02-01 06:25 UTC by Alec Beaton
Modified: 2011-06-25 12:46 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Alec Beaton 2004-02-01 06:25:15 UTC

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 ?

Comment 1 Andy Oliver 2004-02-01 17:13:54 UTC
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.
Comment 2 Alec Beaton 2004-02-02 09:01:34 UTC

Sorry but what is RFE ? and IIRC ?
When Are you planning to enter high level API for this method ? 
Next version or patch ?

Comment 3 Alec Beaton 2004-04-01 15:56:51 UTC

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
Comment 4 Alec Beaton 2004-04-04 00:21:32 UTC
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

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.

Comment 5 Yegor Kozlov 2011-06-25 12:46:59 UTC
HSSFSHeet.setRightToLeft(boolean value) was added in POI 3.6.