List of usage examples for org.apache.poi.hssf.usermodel HSSFCellStyle setHidden
@Override public void setHidden(boolean hidden)
From source file:com.eryansky.core.excelTools.ExcelUtils.java
License:Apache License
public static void copyCellStyle(HSSFWorkbook destwb, HSSFCellStyle dest, HSSFWorkbook srcwb, HSSFCellStyle src) {/*ww w.j a v a2 s . c om*/ if (src == null || dest == null) return; dest.setAlignment(src.getAlignment()); dest.setBorderBottom(src.getBorderBottom()); dest.setBorderLeft(src.getBorderLeft()); dest.setBorderRight(src.getBorderRight()); dest.setBorderTop(src.getBorderTop()); dest.setBottomBorderColor(findColor(src.getBottomBorderColor(), srcwb, destwb)); dest.setDataFormat( destwb.createDataFormat().getFormat(srcwb.createDataFormat().getFormat(src.getDataFormat()))); dest.setFillPattern(src.getFillPattern()); dest.setFillForegroundColor(findColor(src.getFillForegroundColor(), srcwb, destwb)); dest.setFillBackgroundColor(findColor(src.getFillBackgroundColor(), srcwb, destwb)); dest.setHidden(src.getHidden()); dest.setIndention(src.getIndention()); dest.setLeftBorderColor(findColor(src.getLeftBorderColor(), srcwb, destwb)); dest.setLocked(src.getLocked()); dest.setRightBorderColor(findColor(src.getRightBorderColor(), srcwb, destwb)); dest.setRotation(src.getRotation()); dest.setTopBorderColor(findColor(src.getTopBorderColor(), srcwb, destwb)); dest.setVerticalAlignment(src.getVerticalAlignment()); dest.setWrapText(src.getWrapText()); HSSFFont f = srcwb.getFontAt(src.getFontIndex()); HSSFFont nf = findFont(f, srcwb, destwb); if (nf == null) { nf = destwb.createFont(); nf.setBoldweight(f.getBoldweight()); nf.setCharSet(f.getCharSet()); nf.setColor(findColor(f.getColor(), srcwb, destwb)); nf.setFontHeight(f.getFontHeight()); nf.setFontHeightInPoints(f.getFontHeightInPoints()); nf.setFontName(f.getFontName()); nf.setItalic(f.getItalic()); nf.setStrikeout(f.getStrikeout()); nf.setTypeOffset(f.getTypeOffset()); nf.setUnderline(f.getUnderline()); } dest.setFont(nf); }
From source file:com.haulmont.yarg.formatters.impl.xls.hints.CustomCellStyleHint.java
License:Apache License
@Override public void apply() { for (DataObject dataObject : data) { HSSFCell templateCell = dataObject.templateCell; HSSFCell resultCell = dataObject.resultCell; BandData bandData = dataObject.bandData; HSSFWorkbook resultWorkbook = resultCell.getSheet().getWorkbook(); HSSFWorkbook templateWorkbook = templateCell.getSheet().getWorkbook(); String templateCellValue = templateCell.getStringCellValue(); Matcher matcher = pattern.matcher(templateCellValue); if (matcher.find()) { String paramName = matcher.group(1); String styleName = (String) bandData.getParameterValue(paramName); if (styleName == null) continue; HSSFCellStyle cellStyle = styleCache.getStyleByName(styleName); if (cellStyle == null) continue; HSSFCellStyle resultStyle = styleCache.getNamedCachedStyle(cellStyle); if (resultStyle == null) { HSSFCellStyle newStyle = resultWorkbook.createCellStyle(); // color newStyle.setFillBackgroundColor(cellStyle.getFillBackgroundColor()); newStyle.setFillForegroundColor(cellStyle.getFillForegroundColor()); newStyle.setFillPattern(cellStyle.getFillPattern()); // borders newStyle.setBorderLeft(cellStyle.getBorderLeft()); newStyle.setBorderRight(cellStyle.getBorderRight()); newStyle.setBorderTop(cellStyle.getBorderTop()); newStyle.setBorderBottom(cellStyle.getBorderBottom()); // border colors newStyle.setLeftBorderColor(cellStyle.getLeftBorderColor()); newStyle.setRightBorderColor(cellStyle.getRightBorderColor()); newStyle.setBottomBorderColor(cellStyle.getBottomBorderColor()); newStyle.setTopBorderColor(cellStyle.getTopBorderColor()); // alignment newStyle.setAlignment(cellStyle.getAlignment()); newStyle.setVerticalAlignment(cellStyle.getVerticalAlignment()); // misc DataFormat dataFormat = resultWorkbook.getCreationHelper().createDataFormat(); newStyle.setDataFormat(dataFormat.getFormat(cellStyle.getDataFormatString())); newStyle.setHidden(cellStyle.getHidden()); newStyle.setLocked(cellStyle.getLocked()); newStyle.setIndention(cellStyle.getIndention()); newStyle.setRotation(cellStyle.getRotation()); newStyle.setWrapText(cellStyle.getWrapText()); // font HSSFFont cellFont = cellStyle.getFont(templateWorkbook); HSSFFont newFont = fontCache.getFontByTemplate(cellFont); if (newFont == null) { newFont = resultWorkbook.createFont(); newFont.setFontName(cellFont.getFontName()); newFont.setItalic(cellFont.getItalic()); newFont.setStrikeout(cellFont.getStrikeout()); newFont.setTypeOffset(cellFont.getTypeOffset()); newFont.setBoldweight(cellFont.getBoldweight()); newFont.setCharSet(cellFont.getCharSet()); newFont.setColor(cellFont.getColor()); newFont.setUnderline(cellFont.getUnderline()); newFont.setFontHeight(cellFont.getFontHeight()); newFont.setFontHeightInPoints(cellFont.getFontHeightInPoints()); fontCache.addCachedFont(cellFont, newFont); }/*w ww . j a va 2s. c om*/ newStyle.setFont(newFont); resultStyle = newStyle; styleCache.addCachedNamedStyle(cellStyle, resultStyle); } fixNeighbourCellBorders(cellStyle, resultCell); resultCell.setCellStyle(resultStyle); Sheet sheet = resultCell.getSheet(); for (int i = 0; i < sheet.getNumMergedRegions(); i++) { CellRangeAddress mergedRegion = sheet.getMergedRegion(i); if (mergedRegion.isInRange(resultCell.getRowIndex(), resultCell.getColumnIndex())) { int firstRow = mergedRegion.getFirstRow(); int lastRow = mergedRegion.getLastRow(); int firstCol = mergedRegion.getFirstColumn(); int lastCol = mergedRegion.getLastColumn(); for (int row = firstRow; row <= lastRow; row++) for (int col = firstCol; col <= lastCol; col++) sheet.getRow(row).getCell(col).setCellStyle(resultStyle); // cell includes only in one merged region break; } } } } }
From source file:net.sf.jasperreports.engine.export.JRXlsExporter.java
License:Open Source License
protected HSSFCellStyle getLoadedCellStyle(StyleInfo style) { HSSFCellStyle cellStyle = loadedCellStyles.get(style); if (cellStyle == null) { cellStyle = workbook.createCellStyle(); cellStyle.setFillForegroundColor(style.backcolor); cellStyle.setFillPattern(style.mode); cellStyle.setAlignment(style.horizontalAlignment); cellStyle.setVerticalAlignment(style.verticalAlignment); cellStyle.setRotation(style.rotation); cellStyle.setFont(style.font);/*from ww w. j a v a 2 s . c om*/ cellStyle.setWrapText(style.lcWrapText); cellStyle.setLocked(style.lcCellLocked); cellStyle.setHidden(style.lcCellHidden); if (style.hasDataFormat()) { cellStyle.setDataFormat(style.getDataFormat()); } boolean isIgnoreCellBorder = getCurrentItemConfiguration().isIgnoreCellBorder(); if (!isIgnoreCellBorder) { BoxStyle box = style.box; cellStyle.setBorderTop(box.borderStyle[BoxStyle.TOP]); cellStyle.setTopBorderColor(box.borderColour[BoxStyle.TOP]); cellStyle.setBorderLeft(box.borderStyle[BoxStyle.LEFT]); cellStyle.setLeftBorderColor(box.borderColour[BoxStyle.LEFT]); cellStyle.setBorderBottom(box.borderStyle[BoxStyle.BOTTOM]); cellStyle.setBottomBorderColor(box.borderColour[BoxStyle.BOTTOM]); cellStyle.setBorderRight(box.borderStyle[BoxStyle.RIGHT]); cellStyle.setRightBorderColor(box.borderColour[BoxStyle.RIGHT]); } loadedCellStyles.put(style, cellStyle); } return cellStyle; }
From source file:net.sf.jasperreports.engine.export.JRXlsMetadataExporter.java
License:Open Source License
protected HSSFCellStyle getLoadedCellStyle(StyleInfo style) { HSSFCellStyle cellStyle = loadedCellStyles.get(style); if (cellStyle == null) { cellStyle = workbook.createCellStyle(); cellStyle.setFillForegroundColor(style.backcolor); cellStyle.setFillPattern(style.mode); cellStyle.setAlignment(style.horizontalAlignment); cellStyle.setVerticalAlignment(style.verticalAlignment); cellStyle.setRotation(style.rotation); cellStyle.setFont(style.font);//from ww w . j a va 2 s. co m cellStyle.setWrapText(style.lcWrapText); cellStyle.setLocked(style.lcCellLocked); cellStyle.setHidden(style.lcCellHidden); if (style.hasDataFormat()) { cellStyle.setDataFormat(style.getDataFormat()); } if (!getCurrentItemConfiguration().isIgnoreCellBorder()) { BoxStyle box = style.box; cellStyle.setBorderTop(box.borderStyle[BoxStyle.TOP]); cellStyle.setTopBorderColor(box.borderColour[BoxStyle.TOP]); cellStyle.setBorderLeft(box.borderStyle[BoxStyle.LEFT]); cellStyle.setLeftBorderColor(box.borderColour[BoxStyle.LEFT]); cellStyle.setBorderBottom(box.borderStyle[BoxStyle.BOTTOM]); cellStyle.setBottomBorderColor(box.borderColour[BoxStyle.BOTTOM]); cellStyle.setBorderRight(box.borderStyle[BoxStyle.RIGHT]); cellStyle.setRightBorderColor(box.borderColour[BoxStyle.RIGHT]); } loadedCellStyles.put(style, cellStyle); } return cellStyle; }
From source file:org.orbeon.oxf.util.XLSUtils.java
License:Open Source License
public static void copyCell(HSSFWorkbook workbook, HSSFCell destination, HSSFCell source) { // Copy cell content destination.setCellType(source.getCellType()); switch (source.getCellType()) { case HSSFCell.CELL_TYPE_BOOLEAN: destination.setCellValue(source.getBooleanCellValue()); break;//w w w . j ava2s .c o m case HSSFCell.CELL_TYPE_FORMULA: case HSSFCell.CELL_TYPE_STRING: destination.setCellValue(source.getStringCellValue()); break; case HSSFCell.CELL_TYPE_NUMERIC: destination.setCellValue(source.getNumericCellValue()); break; } // Copy cell style HSSFCellStyle sourceCellStyle = source.getCellStyle(); HSSFCellStyle destinationCellStyle = workbook.createCellStyle(); destinationCellStyle.setAlignment(sourceCellStyle.getAlignment()); destinationCellStyle.setBorderBottom(sourceCellStyle.getBorderBottom()); destinationCellStyle.setBorderLeft(sourceCellStyle.getBorderLeft()); destinationCellStyle.setBorderRight(sourceCellStyle.getBorderRight()); destinationCellStyle.setBorderTop(sourceCellStyle.getBorderTop()); destinationCellStyle.setBottomBorderColor(sourceCellStyle.getBottomBorderColor()); destinationCellStyle.setDataFormat(sourceCellStyle.getDataFormat()); destinationCellStyle.setFillBackgroundColor(sourceCellStyle.getFillForegroundColor()); destinationCellStyle.setFillForegroundColor(sourceCellStyle.getFillForegroundColor()); destinationCellStyle.setFillPattern(sourceCellStyle.getFillPattern()); destinationCellStyle.setFont(workbook.getFontAt(sourceCellStyle.getFontIndex())); destinationCellStyle.setHidden(sourceCellStyle.getHidden()); destinationCellStyle.setIndention(sourceCellStyle.getIndention()); destinationCellStyle.setLeftBorderColor(sourceCellStyle.getLeftBorderColor()); destinationCellStyle.setLocked(sourceCellStyle.getLocked()); destinationCellStyle.setRightBorderColor(sourceCellStyle.getRightBorderColor()); destinationCellStyle.setRotation(sourceCellStyle.getRotation()); destinationCellStyle.setTopBorderColor(sourceCellStyle.getTopBorderColor()); destinationCellStyle.setVerticalAlignment(sourceCellStyle.getVerticalAlignment()); destinationCellStyle.setWrapText(sourceCellStyle.getWrapText()); destination.setCellStyle(destinationCellStyle); }
From source file:vista.AforoPanel.java
public HSSFWorkbook ObtenerDatosExcel() { List<Vertical> verticales = new ArrayList(); List<Celda> celdas = new ArrayList(); verjpa = new VerticalJPA(); celjpa = new CeldaJPA(); verticales = verjpa.ListarVerticales(aforo.getIdaforo()); celdas = celjpa.ListarCeldas(aforo.getIdaforo()); //verticales = (List<Vertical>) aforo.getVerticalCollection(); //celdas = (List<Celda>) aforo.getCeldaCollection(); HSSFWorkbook libro = new HSSFWorkbook(); HSSFSheet hoja = libro.createSheet(); HSSFCellStyle style = libro.createCellStyle(); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setWrapText(true);/*from ww w .j av a 2 s . c om*/ style.setHidden(true); style.setShrinkToFit(true); SimpleDateFormat date = new SimpleDateFormat("dd-MM-yyyy"); SimpleDateFormat hour = new SimpleDateFormat("HH:mm:ss"); Calendar fecha = Calendar.getInstance(); fecha.set(aforo.getAnho(), aforo.getMes() - 1, aforo.getDia(), aforo.getHoraInicio(), aforo.getMinutoInicio(), aforo.getSegundoInicio()); //*****************DATOS AFORRO***********************// HSSFRow fila = hoja.createRow(2); HSSFCell celda = fila.createCell((int) 3); celda.setCellValue("AFORO"); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("VERTICAL 1"); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("CELDA 1"); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(3); celda = fila.createCell((int) 3); celda.setCellValue("Nombre"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getNombre()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Profundidad[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getProfundidad()); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("Ancho[m]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(0).getProfundidad()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(4); celda = fila.createCell((int) 3); celda.setCellValue("Tipo"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getTipoAforo()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Dist_a_orilla[m]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getDistOrilla()); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("Profundidad[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(0).getAncho()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(5); celda = fila.createCell((int) 3); celda.setCellValue("Helice"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getHelice()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidad()); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("Area[m^2]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(0).getArea()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(6); celda = fila.createCell((int) 3); celda.setCellValue("Numero de Celdas"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getNumeroCeldas()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_sup[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidadSup()); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("Velocidad[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(0).getVelocidad()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(7); celda = fila.createCell((int) 3); celda.setCellValue("Numero de Verticales"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getNumeroVerticales()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_fondo[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidadFondo()); celda.setCellStyle(style); celda = fila.createCell((int) 10); celda.setCellValue("Caudal[m^3/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(0).getCaudal()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(8); celda = fila.createCell((int) 3); celda.setCellValue("Tiempo de Aforo[s]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getTiempoAforo()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_20[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidad20()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(9); celda = fila.createCell((int) 3); celda.setCellValue("Fecha"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(date.format(fecha.getTime())); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_40[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidad40()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(10); celda = fila.createCell((int) 3); celda.setCellValue("Hora inicio"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(hour.format(fecha.getTime())); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_60[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidad60()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(11); celda = fila.createCell((int) 3); celda.setCellValue("Hora fin"); celda.setCellStyle(style); celda = fila.createCell((int) 4); fecha.set(aforo.getAnho(), aforo.getMes() - 1, aforo.getDia(), aforo.getHoraFin(), aforo.getMinutoFin(), aforo.getSegundoFin()); celda.setCellValue(hour.format(fecha.getTime())); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_80[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVelocidad80()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(12); celda = fila.createCell((int) 3); celda.setCellValue("Longitud total[m]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getLongitudTotal()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_sup[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltasSup()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(13); celda = fila.createCell((int) 3); celda.setCellValue("Profundidad media[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getProfundidadMedia()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_fondo[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltasFondo()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(14); celda = fila.createCell((int) 3); celda.setCellValue("Velocidad media[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getVelocidadMedia()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_20[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltas20()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(15); celda = fila.createCell((int) 3); celda.setCellValue("Area total[m^2]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getAreaTotal()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_40[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltas40()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(16); celda = fila.createCell((int) 3); celda.setCellValue("Caudal total[m^3/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getCaudalTotal()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_60[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltas60()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(17); celda = fila.createCell((int) 3); celda.setCellValue("Mira inicial[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getMiraInicial()); celda.setCellStyle(style); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_80[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(0).getVueltas80()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(18); celda = fila.createCell((int) 3); celda.setCellValue("Mira final[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 4); celda.setCellValue(aforo.getMiraFinal()); celda.setCellStyle(style); //******************************************// //*****************DATOS VERTICALES***********************// for (int i = 1; i < verticales.size(); i++) { fila = hoja.createRow(3 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("VERTICAL " + (i + 1)); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("CELDA " + (i + 1)); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(4 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Profundidad[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getProfundidad()); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("Ancho[m]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(i).getAncho()); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(5 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Dist_a_orilla[m]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getDistOrilla()); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("Profundidad[cm]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(i).getProfundidad()); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(6 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidad()); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("Area[m^2]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(i).getArea()); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(7 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_sup[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidadSup()); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("Velocidad[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(i).getVelocidad()); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(8 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_fondo[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidadFondo()); celda.setCellStyle(style); if (i < celdas.size()) { celda = fila.createCell((int) 10); celda.setCellValue("Caudal[m^3/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 11); celda.setCellValue(celdas.get(i).getCaudal()); celda.setCellStyle(style); } //******************************************// fila = hoja.createRow(9 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_20[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidad20()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(10 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_40[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidad40()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(11 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_60[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidad60()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(12 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Velocidad_80[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVelocidad80()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(13 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_sup[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltasSup()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(14 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_fondo[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltasFondo()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(15 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_20[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltas20()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(16 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_40[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltas40()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(17 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_60[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltas60()); celda.setCellStyle(style); //******************************************// fila = hoja.createRow(18 + (17 * i)); celda = fila.createCell((int) 7); celda.setCellValue("Vueltas_80[m/s]"); celda.setCellStyle(style); celda = fila.createCell((int) 8); celda.setCellValue(verticales.get(i).getVueltas80()); celda.setCellStyle(style); } for (int i = 0; i < 12; i++) { hoja.autoSizeColumn(i); } return libro; }