Java - Crear tabla dinamica con libreria poi Apache

 
Vista:
Imágen de perfil de Zirt

Crear tabla dinamica con libreria poi Apache

Publicado por Zirt (1 intervención) el 21/02/2014 00:25:05
Hola, alguien sabe como crear una tabla dinamica en excel con la libreria poi de Apache?
estoy utilizando el IDE netbeans, lenguaje java, libreria poi 3.7.

Se los agradecere
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Crear tabla dinamica con libreria poi Apache

Publicado por adolfo angel (1 intervención) el 27/11/2017 16:12:36
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
//Genera la tabla dinamica
public XSSFWorkbook generatabladinamica(XSSFWorkbook workbook, Sheet sheet, int size, InputStream file, String name) {
/////////////////////////////////tabla dinamica en hoja dos
    int firstRow = 2;//sheet.getFirstRowNum();
    int lastRow = sheet.getLastRowNum();
    int firstCol = 1;//sheet.getRow(2).getFirstCellNum();
    int lastCol = sheet.getRow(2).getLastCellNum();
 
    //---------------------------------------------------------\\
    CellReference topleft = new CellReference(firstRow, firstCol);
    CellReference botRigth = new CellReference(lastRow, lastCol - 1);
    //---------------------------------------------------------\\
    XSSFSheet hoja2 = workbook.createSheet("TABLA");
 
    setcolor(workbook, hoja2, size);//AGREGAR EL PRIMER COLOR
    setimagen(workbook, hoja2, name, file);//AGREGA LA IMAGEN 
 
    CellReference createpivot = new CellReference("C6");
    AreaReference source = new AreaReference(topleft, botRigth);
    //---------------------------------------------------------\\
    XSSFPivotTable pivotTable = hoja2.createPivotTable(source, createpivot, sheet);
 
    pivotTable.addReportFilter(0);
    pivotTable.addRowLabel(6);
    pivotTable.addRowLabel(7);
    //pivotTable.addRowLabel(9);
 
    pivotTable.addColumnLabel(DataConsolidateFunction.COUNT, 3, "Total");
 
    return workbook;
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar