J'essaye de créer une nouvelle feuille Excel en utilisant l'API JAVA APACHE POI. Dans certains cas, cette feuille doit être de droite à gauche.

Je sais comment le faire manuellement de droite à gauche, mais je ne trouve pas comment le faire de maniere programmable.

Le code qui crée le speardsheet est simple:



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
    workbook = new XSSFWorkbook();
 
       //for .xlsx workbook use HSSworkbook();
 
        //Create sheet
        sheet = workbook.createSheet("Tasks");
 
        // dont know if it is the right function to do it ?
        sheet.setRightToLeft();
 
        //Create top row with   column headings 
        String [] ColumnHeadings = {"Text Area","Field Comment","Date","Date Begin","Date Finish"};
 
 ........
 
// and populate it with data
        int rownum = 1;
        for(Task_User task : list_task) {
 
            row =  sheet.createRow(rownum++);
 
            row.createCell(0).setCellValue(task.getAreaDescription());
            row.createCell(1).setCellValue(task.getField_Comment());
 
            Cell dateCell = row.createCell(2);
            dateCell.setCellValue(task.getDate());
            dateCell.setCellStyle(dateStyle);
 
            Cell date_beginCell = row.createCell(3);
            date_beginCell.setCellValue(task.getDate_begin());
            date_beginCell.setCellStyle(dateStyle);
 
            Cell date_finishCell = row.createCell(4);
            date_finishCell.setCellValue(task.getDate_finish());
            date_finishCell.setCellStyle(dateStyle);
 
        }
je cherche a ce que le tableau entier soit de droite a gauche
voila le resultat :

Nom : Annotation 2020-08-18 162451.png
Affichages : 431
Taille : 192,7 Ko