Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFFont


    return style;
  }

  public static HSSFCellStyle enteteColonne(HSSFWorkbook wb)
  {
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    return style;
View Full Code Here


public class Styles
{

  public static HSSFCellStyle titrePrincipal(HSSFWorkbook wb)
  {
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 18);
    font.setFontName("Arial");

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    return style;
View Full Code Here

    sheet.setColumnWidth((short) 12, (short) 3000);
    sheet.setColumnWidth((short) 13, (short) 6500);
    sheet.setColumnWidth((short) 14, (short) 6500);

    // --------- En-tête -----------
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 18);
    font.setFontName("Arial");

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    HSSFRow row = sheet.createRow((short) 0);
    final HSSFCell cell = row.createCell((short) 0);
    cell.setCellValue(new HSSFRichTextString(course.getEvenement()
        .getSaison().getNom()
        + " - "
        + course.getEvenement().getNom()
        + " - "
        + course.getNom() + " - Liste des inscriptions"));
    cell.setCellStyle(style);

    // --------- Séparateur -----------
    sheet.createRow((short) 1);

    // --------- En-tête de colonne -------
    font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    style = wb.createCellStyle();
    style.setFont(font);

    row = sheet.createRow((short) 2);
View Full Code Here

    sheet.setColumnWidth((short) 12, (short) 3000);
    sheet.setColumnWidth((short) 13, (short) 6500);
    sheet.setColumnWidth((short) 14, (short) 6500);

    // --------- En-tête -----------
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 18);
    font.setFontName("Arial");

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    HSSFRow row = sheet.createRow((short) 0);
    final HSSFCell cell = row.createCell((short) 0);
    cell.setCellValue(new HSSFRichTextString(course.getEvenement()
        .getSaison().getNom()
        + " - "
        + course.getEvenement().getNom()
        + " - "
        + course.getNom() + " - Liste des inscriptions avec Équipes"));
    cell.setCellStyle(style);

    // --------- Séparateur -----------
    sheet.createRow((short) 1);

    // --------- En-tête de colonne -------
    font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    style = wb.createCellStyle();
    style.setFont(font);

    row = sheet.createRow((short) 2);
View Full Code Here

      row.createCell((short) 2).setCellValue(
          new HSSFRichTextString("Équipe : "
              + equipeCourse.getNomEquipe()));
    }

    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    HSSFUtils.applyStyle(row, style);
View Full Code Here

    sheet.setColumnWidth((short) 5, (short) 2000);
    sheet.setColumnWidth((short) 6, (short) 2000);
    sheet.setColumnWidth((short) 7, (short) 6000);

    // --------- En-tête de colonne -------
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    HSSFRow row = sheet.createRow((short) 0);
View Full Code Here

        sheet.setColumnWidth((short) 6, (short) 7000);
        sheet.setColumnWidth((short) 7, (short) 3500);
        sheet.setColumnWidth((short) 8, (short) 3500);

        // --------- En-tête -----------
        HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 18);
        font.setFontName("Arial");

        HSSFCellStyle style = wb.createCellStyle();
        style.setFont(font);

        HSSFRow row = sheet.createRow((short) 0);
        HSSFCell cell = row.createCell((short) 0);
        cell.setCellValue(ListeInscritsPanel.this.course.getEvenement().getSaison().getNom()
            + " - " + ListeInscritsPanel.this.course.getEvenement().getNom() + " - "
            + ListeInscritsPanel.this.course.getNom() + " - Liste des inscriptions");
        cell.setCellStyle(style);

        // --------- Séparateur -----------
        sheet.createRow((short) 1);

        // --------- En-tête de colonne -------
        font = wb.createFont();
        font.setFontHeightInPoints((short) 10);
        font.setFontName("Arial");
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        style = wb.createCellStyle();
        style.setFont(font);

        row = sheet.createRow((short) 2);
View Full Code Here

    sheet.setColumnWidth((short) 10, (short) 2000);
    sheet.setColumnWidth((short) 11, (short) 3000);
    sheet.setColumnWidth((short) 12, (short) 6000);

    // --------- En-tête de colonne -------
    HSSFFont font = wb.createFont();
    HSSFCellStyle style = wb.createCellStyle();

    font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    style = wb.createCellStyle();
    style.setFont(font);

    HSSFRow row = sheet.createRow((short) 0);
View Full Code Here

            PlaqueAttribueeLine.COMP_NOM_PRENOM);

        final HSSFWorkbook wb = new HSSFWorkbook();
        int page = -1;

        final HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 12);
        font.setFontName("Arial");

        final HSSFCellStyle style = wb.createCellStyle();
        style.setFont(font);

        for (final Iterator iter = saison.getCategoriesParticipantes()
            .iterator(); iter.hasNext();)
        {
          final CategorieParticipante catPart = (CategorieParticipante) iter
              .next();

          Collection<PlaqueAttribueeLine> plaquesCategorie = selectStr
              .getResult(catPart.getCategorie(), plaques);
          plaquesCategorie = orderStr.getResult(plaquesCategorie);

          final Iterator<PlaqueAttribueeLine> itLine = plaquesCategorie
              .iterator();

          while (itLine.hasNext())
          {
            final HSSFSheet sheet = this.newSheet(wb, catPart
                .getCategorie(), ++page);
            sheet.getPrintSetup().setLandscape(true);

            for (short j = 0; j < ListePlaquePanel.COLONNES_PAR_PAGE; j++)
            {
              for (short k = 0; k < ListePlaquePanel.LIGNES_PAR_PAGE; k++)
              {
                if (itLine.hasNext())
                {
                  final PlaqueAttribueeLine line = itLine
                      .next();

                  final HSSFRow row = sheet.createRow(this
                      .getIndexLigne(k));

                  HSSFCell cell = row
                      .createCell(this
                          .getIndexColonne(
                              j,
                              ListePlaquePanel.INDEX_PLAQUE));
                  cell.setCellValue(line.getPlaque());
                  cell.setCellStyle(style);

                  cell = row.createCell(this.getIndexColonne(
                      j, ListePlaquePanel.INDEX_NOM));
                  cell.setCellValue(line.getNomPrenom());
                  cell.setCellStyle(style);

                  cell = row
                      .createCell(this
                          .getIndexColonne(
                              j,
                              ListePlaquePanel.INDEX_COMMENTAIRE));
                  cell.setCellValue(line.getCommentaire());
                  cell.setCellStyle(style);
                }
                else
                {
                  break;
                }
              }
            }
          }

          page = -1;
        }

        try
        {
          FileOutputStream fileOut = new FileOutputStream("temp.xls");
          wb.write(fileOut);
          fileOut.close();
        }
        catch (FileNotFoundException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        catch (IOException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }

        return new FileResourceStream(new File("temp.xls"));
      }

      @Override
      protected void setHeaders(WebResponse response)
      {
        super.setHeaders(response);
        response.setAttachmentHeader("Plaques - "
            + saison.getAnnee().toString() + ".xls");
      }

      private HSSFSheet newSheet(final HSSFWorkbook wb,
          final Categorie categorie, final int page)
      {
        final HSSFSheet sheet = wb.createSheet(categorie
            .getCodeCategorie()
            + " " + categorie.getSexe() + "(" + page + ")");

        sheet.setColumnWidth((short) 0, (short) 2500);
        sheet.setColumnWidth((short) 1, (short) 8500);
        sheet.setColumnWidth((short) 2, (short) 3500);
        sheet.setColumnWidth((short) 3, (short) 1000);
        sheet.setColumnWidth((short) 4, (short) 2500);
        sheet.setColumnWidth((short) 5, (short) 8500);
        sheet.setColumnWidth((short) 6, (short) 3500);

        // --------- En-tête -----------
        HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 36);
        font.setFontName("Arial");
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        HSSFCellStyle style = wb.createCellStyle();
        style.setFont(font);

        HSSFRow row = sheet.createRow((short) 0);
        HSSFCell cell = row.createCell((short) 0);
        cell.setCellValue("XC");

        sheet.addMergedRegion(new Region(0, (short) 0, 0, (short) 1));

        cell = row.createCell((short) 2);
        cell.setCellValue(categorie.getNom());

        sheet.addMergedRegion(new Region(0, (short) 2, 0, (short) 5));

        cell = row.createCell((short) 6);
        cell.setCellValue(categorie.getSexe());

        HSSFUtils.applyStyle(row, style);

        // ------- Séparateur -----------
        row = sheet.createRow((short) 1);
        row.setHeightInPoints(new Float(7.5));

        row = sheet.createRow((short) 2);

        for (short i = 0; i < ListePlaquePanel.COLONNES_PAR_PAGE; i++)
        {
          cell = row.createCell(this.getIndexColonne(i,
              ListePlaquePanel.INDEX_PLAQUE));
          cell.setCellValue("PLAQUE");

          cell = row.createCell(this.getIndexColonne(i,
              ListePlaquePanel.INDEX_NOM));
          cell.setCellValue("NOM, PRÉNOM");

          cell = row.createCell(this.getIndexColonne(i,
              ListePlaquePanel.INDEX_COMMENTAIRE));
          cell.setCellValue("");
        }

        font = wb.createFont();
        font.setFontHeightInPoints((short) 10);
        font.setFontName("Arial");
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        style = wb.createCellStyle();
        style.setFont(font);

        HSSFUtils.applyStyle(row, style);
View Full Code Here

    sheet.setColumnWidth((short) 10, (short) 5000);
    sheet.setColumnWidth((short) 11, (short) 5000);
    sheet.setColumnWidth((short) 12, (short) 5000);

    // --------- En-tête -----------
    HSSFFont font = wb.createFont();
    font.setFontHeightInPoints((short) 18);
    font.setFontName("Arial");

    HSSFCellStyle style = wb.createCellStyle();
    style.setFont(font);

    HSSFRow row = sheet.createRow((short) 0);
    final HSSFCell cell = row.createCell((short) 0);
    cell.setCellValue(new HSSFRichTextString(evenement.getNom()
        + " - Liste des articles"));
    cell.setCellStyle(style);

    // --------- Séparateur -----------
    sheet.createRow((short) 1);

    // --------- En-tête de colonne -------
    font = wb.createFont();
    font.setFontHeightInPoints((short) 10);
    font.setFontName("Arial");
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

    style = wb.createCellStyle();
    style.setFont(font);

    row = sheet.createRow((short) 2);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFFont

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.