|
Lines 22-27
Link Here
|
| 22 |
public class ExcelWriter |
22 |
public class ExcelWriter |
| 23 |
{ |
23 |
{ |
| 24 |
|
24 |
|
|
|
25 |
private boolean isRTLSheet = false; //bidi_acgc added |
| 26 |
public static final int rightToLeftisTrue = 1; //bidi_acgc added |
| 27 |
|
| 25 |
private XMLWriterXLS writer = new XMLWriterXLS( ); |
28 |
private XMLWriterXLS writer = new XMLWriterXLS( ); |
| 26 |
|
29 |
|
| 27 |
private static HashSet splitChar = new HashSet( ); |
30 |
private static HashSet splitChar = new HashSet( ); |
|
Lines 99-104
Link Here
|
| 99 |
writer.open( out, encoding ); |
102 |
writer.open( out, encoding ); |
| 100 |
} |
103 |
} |
| 101 |
|
104 |
|
|
|
105 |
//bidi_acgc added start |
| 106 |
//ExcelWriter constructors are overloaded in order to set the isRTLReport parameter. |
| 107 |
//isRTLReport represents the direction of the excel sheet |
| 108 |
/** |
| 109 |
* @author bidi_acgc |
| 110 |
* @param isRTLSheet: represents the direction of the excel sheet. |
| 111 |
*/ |
| 112 |
public ExcelWriter( OutputStream out , boolean isRTLSheet) |
| 113 |
{ |
| 114 |
this.isRTLSheet = isRTLSheet; |
| 115 |
writer.open( out, "UTF-8" ); |
| 116 |
} |
| 117 |
/** |
| 118 |
* @author bidi_acgc |
| 119 |
* @param isRTLSheet: represents the direction of the excel sheet. |
| 120 |
*/ |
| 121 |
public ExcelWriter( OutputStream out , ExcelContext context, boolean isRTLSheet ) |
| 122 |
{ |
| 123 |
this( out, "UTF-8" , context); |
| 124 |
this.isRTLSheet = isRTLSheet; |
| 125 |
} |
| 126 |
/** |
| 127 |
* @author bidi_acgc |
| 128 |
* @param isRTLSheet: represents the direction of the excel sheet. |
| 129 |
*/ |
| 130 |
public ExcelWriter( OutputStream out, String encoding, ExcelContext context, boolean isRTLSheet ) |
| 131 |
{ |
| 132 |
this.context = context; |
| 133 |
this.isRTLSheet = isRTLSheet; |
| 134 |
writer.open( out, encoding ); |
| 135 |
} |
| 136 |
//bidi_acgc added end |
| 137 |
|
| 102 |
// If possible, we can pass a format according the data type |
138 |
// If possible, we can pass a format according the data type |
| 103 |
public void writeText( Data d ) |
139 |
public void writeText( Data d ) |
| 104 |
{ |
140 |
{ |
|
Lines 607-612
Link Here
|
| 607 |
{ |
643 |
{ |
| 608 |
writer.openTag( "Worksheet" ); |
644 |
writer.openTag( "Worksheet" ); |
| 609 |
writer.attribute( "ss:Name", name ); |
645 |
writer.attribute( "ss:Name", name ); |
|
|
646 |
//bidi_acgc added start |
| 647 |
// Set the Excel Sheet RightToLeft attribute according to Report |
| 648 |
//if Report Bidi-Orientation is RTL, then Sheet is RTL. |
| 649 |
if (isRTLSheet) |
| 650 |
writer.attribute( "ss:RightToLeft", rightToLeftisTrue ); |
| 651 |
//else : do nothing i.e. LTR |
| 652 |
//bidi_acgc added end |
| 610 |
} |
653 |
} |
| 611 |
|
654 |
|
| 612 |
public void startSheet( int sheetIndex ) |
655 |
public void startSheet( int sheetIndex ) |