Incompatibilidade rowEditor e dataExporter

3 respostas
R

Olá,

Alguém sabe como fazer funcionar o dataexporter com o roweditor?

Na hora que exporta, os dados na planilha ficam:
org.primefaces.component.celleditor.CellEditor@16c277b

3 Respostas

R

nada?

nana_ps

http://forum.primefaces.org/viewtopic.php?f=3&t=5000

R

A sugestão no forum é colocar um post processor

public void postProcessXLS(Object document) {
        HSSFWorkbook wb = (HSSFWorkbook)document;
        HSSFSheet sheet = wb.getSheetAt(0);

        Iterator<HSSFRow> rit = sheet.rowIterator();

        if( rit.hasNext() ) {
            rit.next(); // Skip header row
        }

        while( rit.hasNext() ) {
            HSSFRow row = rit.next();

            Iterator<HSSFCell> cit = row.cellIterator();

            while( cit.hasNext() ) {
                HSSFCell cell = cit.next();

                if( cell.getCellType() == HSSFCell.CELL_TYPE_STRING ) {
                    String content = cell.getRichStringCellValue().toString();

                    int index = content.indexOf( "org.primefaces.component.celleditor" );

                    if( index != -1 ) {
                        content = content.substring( 0, index );
                        cell.setCellValue( new HSSFRichTextString( content ) );
                    }
                }
            }
        }
    }

eu coloquei e agora ao inves de aparecer a mensagem la, aparece tudo em branco

Criado 2 de março de 2012
Ultima resposta 10 de abr. de 2012
Respostas 3
Participantes 2