Package org.apache.poi.ss.util

Examples of org.apache.poi.ss.util.CellRangeAddress


    mySheet.setDefaultColumnWidth(15);
    mySheet.setColumnWidth(0, 7000);
   
    myWorkBook.setSheetName(0, "Dreijahresreport");

    cra = new CellRangeAddress(0, 0, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myRow = mySheet.createRow(0);
   
    myCell = myRow.createCell(0);
View Full Code Here


    double sozVersAN = 0;
    double gehaltNetto = 0;
    double sozVersAG = 0;
    double gesamtkosten = 0;
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    HSSFCellStyle emptyRightCellStyle = myWorkBook.createCellStyle();
    emptyRightCellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
   
    HSSFCellStyle emptyCellStyle = myWorkBook.createCellStyle();
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    myCell.setCellValue("");
    myCell.setCellStyle(emptyRightCellStyle);
  }
 
  public void writeMonth(int k, int j){
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

              "Soz. Vers. AN",
              "Gehalt Netto",
              "Soz. Vers. AG",
              "Gesamtkosten"};

    cra = new CellRangeAddress(0, 0, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myRow = mySheet.createRow(0);
   
    myCell = myRow.createCell(0);
    myCell.setCellValue("�bersicht aller Abrechnungen zwichen "+df.format(startDat)+" und "+df.format(endDat));
   
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 350);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
   
    myCellStyle = myWorkBook.createCellStyle();
    myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setFillForegroundColor(HSSFColor.GREY_80_PERCENT.index);
    myCellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
    myCellStyle.setFont(myFont);
    myCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
   
    myCell.setCellStyle(myCellStyle);
   
    for(int i = 1; i < 7; i++){
      myCell = myRow.createCell(i);
      myCellStyle = myWorkBook.createCellStyle();
      myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
      myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
      myCell.setCellStyle(myCellStyle);
    }
   
    myCell = myRow.createCell(7);
    myCellStyle = myWorkBook.createCellStyle();
    myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderRight(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
    myCell.setCellStyle(myCellStyle);
   
    HSSFCellStyle dateCellStyle = myWorkBook.createCellStyle();
    dateCellStyle.setDataFormat(HSSFDataFormat
        .getBuiltinFormat("m/d/yy"));
    dateCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    dateCellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
   
    HSSFCellStyle euroCellStyle = myWorkBook.createCellStyle();
    euroCellStyle.setDataFormat(myWorkBook.createDataFormat().getFormat("#,##0.00 �"));
    euroCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    euroCellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
   
    HSSFCellStyle euroRightCellStyle = myWorkBook.createCellStyle();
    euroRightCellStyle.setDataFormat(myWorkBook.createDataFormat().getFormat("#,##0.00 �"));
    euroRightCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    euroRightCellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
   
    while(rs.next()){
      if(rs.getDate("BuchungsDat").getMonth() != lastMonth){
        lastMonth = rs.getDate("BuchungsDat").getMonth();
        monatList  .get(lastMonth)
              .getMitarbList()
              .add(new Mitarbeiter(   rs.getInt("Personen.PersID"),
                          rs.getString("Personen.Nachname"),
                          rs.getString("Personen.Vorname")));
        int size = monatList  .get(lastMonth)
                    .getMitarbList()
                    .size()-1;
       
        monatList  .get(lastMonth)
              .getMitarbList()
              .get(size)
              .getGehaltList()
              .add(new Gehaltrs.getDate("BuchungsDat"),
                        rs.getDouble("gehaltausgezahlt.GehBrutto")+
                          rs.getDouble("gehaltausgezahlt.sonstBezug")-
                          rs.getDouble("gehaltausgezahlt.sonstAbzug"),
                        rs.getDouble("gehaltausgezahlt.LSt")+
                          rs.getDouble("gehaltausgezahlt.KiSt")+
                          rs.getDouble("gehaltausgezahlt.Soli"),
                        rs.getDouble("gehaltausgezahlt.RVAN")+
                          rs.getDouble("gehaltausgezahlt.KVAN")+
                          rs.getDouble("gehaltausgezahlt.ALVAN")+
                          rs.getDouble("gehaltausgezahlt.PVAN"),
                        rs.getDouble("gehaltausgezahlt.GehNetto"),
                        rs.getDouble("gehaltausgezahlt.RVAG")+
                          rs.getDouble("gehaltausgezahlt.KVAG")+
                          rs.getDouble("gehaltausgezahlt.ALVAG")+
                          rs.getDouble("gehaltausgezahlt.PVAG")));
      }else{
        int lastMitarb = monatList.get(lastMonth).getMitarbList().size()-1;
       
        if(rs.getInt("Personen.PersID") != monatList.get(lastMonth).getMitarbList().get(lastMitarb).id){
          monatList  .get(lastMonth)
          .getMitarbList()
          .add(new Mitarbeiter(   rs.getInt("Personen.PersID"),
                      rs.getString("Personen.Nachname"),
                      rs.getString("Personen.Vorname")));
          lastMitarb++;
          monatList  .get(lastMonth)
          .getMitarbList()
          .get(lastMitarb)
          .getGehaltList()
          .add(new Gehaltrs.getDate("BuchungsDat"),
              rs.getDouble("gehaltausgezahlt.GehBrutto")+
                rs.getDouble("gehaltausgezahlt.sonstBezug")-
                rs.getDouble("gehaltausgezahlt.sonstAbzug"),
              rs.getDouble("gehaltausgezahlt.LSt")+
                rs.getDouble("gehaltausgezahlt.KiSt")+
                rs.getDouble("gehaltausgezahlt.Soli"),
              rs.getDouble("gehaltausgezahlt.RVAN")+
                rs.getDouble("gehaltausgezahlt.KVAN")+
                rs.getDouble("gehaltausgezahlt.ALVAN")+
                rs.getDouble("gehaltausgezahlt.PVAN"),
              rs.getDouble("gehaltausgezahlt.GehNetto"),
              rs.getDouble("gehaltausgezahlt.RVAG")+
                rs.getDouble("gehaltausgezahlt.KVAG")+
                rs.getDouble("gehaltausgezahlt.ALVAG")+
                rs.getDouble("gehaltausgezahlt.PVAG")));
        }else{
          monatList  .get(lastMonth)
          .getMitarbList()
          .get(lastMitarb)
          .getGehaltList()
          .add(new Gehaltrs.getDate("BuchungsDat"),
              rs.getDouble("gehaltausgezahlt.GehBrutto")+
                rs.getDouble("gehaltausgezahlt.sonstBezug")-
                rs.getDouble("gehaltausgezahlt.sonstAbzug"),
              rs.getDouble("gehaltausgezahlt.LSt")+
                rs.getDouble("gehaltausgezahlt.KiSt")+
                rs.getDouble("gehaltausgezahlt.Soli"),
              rs.getDouble("gehaltausgezahlt.RVAN")+
                rs.getDouble("gehaltausgezahlt.KVAN")+
                rs.getDouble("gehaltausgezahlt.ALVAN")+
                rs.getDouble("gehaltausgezahlt.PVAN"),
              rs.getDouble("gehaltausgezahlt.GehNetto"),
              rs.getDouble("gehaltausgezahlt.RVAG")+
                rs.getDouble("gehaltausgezahlt.KVAG")+
                rs.getDouble("gehaltausgezahlt.ALVAG")+
                rs.getDouble("gehaltausgezahlt.PVAG")));
        }
      }
    }
     
    int monat = startCal.get(Calendar.MONTH);
    int jahr = startCal.get(Calendar.YEAR);
     
    for(int j = 0; j < 12; j++){
     
      cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
      mySheet.addMergedRegion( cra );
     
      myFont = myWorkBook.createFont();
      myFont.setFontHeight((short) 240);
      myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    myCell.setCellValue("");
    myCell.setCellStyle(emptyRightCellStyle);
  }
 
  private void createGesSumRows(){
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

              "Soz. Vers. AN",
              "Gehalt Netto",
              "Soz. Vers. AG",
              "Gesamtkosten"};

    cra = new CellRangeAddress(0, 0, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myRow = mySheet.createRow(0);
   
    myCell = myRow.createCell(0);
    myCell.setCellValue("�bersicht aller Abrechnungen zwichen "+df.format(startDat)+" und "+df.format(endDat));
   
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 350);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
   
    myCellStyle = myWorkBook.createCellStyle();
    myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setFillForegroundColor(HSSFColor.GREY_80_PERCENT.index);
    myCellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
    myCellStyle.setFont(myFont);
    myCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
   
    myCell.setCellStyle(myCellStyle);
   
    for(int i = 1; i < 7; i++){
      myCell = myRow.createCell(i);
      myCellStyle = myWorkBook.createCellStyle();
      myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
      myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
      myCell.setCellStyle(myCellStyle);
    }
   
    myCell = myRow.createCell(7);
    myCellStyle = myWorkBook.createCellStyle();
    myCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderRight(HSSFCellStyle.BORDER_THICK);
    myCellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);
    myCell.setCellStyle(myCellStyle);
   
    HSSFCellStyle dateCellStyle = myWorkBook.createCellStyle();
    dateCellStyle.setDataFormat(HSSFDataFormat
        .getBuiltinFormat("m/d/yy"));
    dateCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    dateCellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
   
    HSSFCellStyle euroCellStyle = myWorkBook.createCellStyle();
    euroCellStyle.setDataFormat(myWorkBook.createDataFormat().getFormat("#,##0.00 �"));
    euroCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    euroCellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
   
    HSSFCellStyle euroRightCellStyle = myWorkBook.createCellStyle();
    euroRightCellStyle.setDataFormat(myWorkBook.createDataFormat().getFormat("#,##0.00 �"));
    euroRightCellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    euroRightCellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
   
    while(rs.next()){
      if(rs.getDate("BuchungsDat").getMonth() != lastMonth){
        lastMonth = rs.getDate("BuchungsDat").getMonth();
        monatList  .get(lastMonth)
              .getMitarbList()
              .add(new Mitarbeiter(   rs.getInt("Personen.PersID"),
                          rs.getString("Personen.Nachname"),
                          rs.getString("Personen.Vorname")));
        int size = monatList  .get(lastMonth)
                    .getMitarbList()
                    .size()-1;
       
        monatList  .get(lastMonth)
              .getMitarbList()
              .get(size)
              .getGehaltList()
              .add(new Gehaltrs.getDate("BuchungsDat"),
                        rs.getDouble("gehaltausgezahlt.GehBrutto")+
                          rs.getDouble("gehaltausgezahlt.sonstBezug")-
                          rs.getDouble("gehaltausgezahlt.sonstAbzug"),
                        rs.getDouble("gehaltausgezahlt.LSt")+
                          rs.getDouble("gehaltausgezahlt.KiSt")+
                          rs.getDouble("gehaltausgezahlt.Soli"),
                        rs.getDouble("gehaltausgezahlt.RVAN")+
                          rs.getDouble("gehaltausgezahlt.KVAN")+
                          rs.getDouble("gehaltausgezahlt.ALVAN")+
                          rs.getDouble("gehaltausgezahlt.PVAN"),
                        rs.getDouble("gehaltausgezahlt.GehNetto"),
                        rs.getDouble("gehaltausgezahlt.RVAG")+
                          rs.getDouble("gehaltausgezahlt.KVAG")+
                          rs.getDouble("gehaltausgezahlt.ALVAG")+
                          rs.getDouble("gehaltausgezahlt.PVAG")));
      }else{
        int lastMitarb = monatList.get(lastMonth).getMitarbList().size()-1;
       
        if(rs.getInt("Personen.PersID") != monatList.get(lastMonth).getMitarbList().get(lastMitarb).id){
          monatList  .get(lastMonth)
          .getMitarbList()
          .add(new Mitarbeiter(   rs.getInt("Personen.PersID"),
                      rs.getString("Personen.Nachname"),
                      rs.getString("Personen.Vorname")));
          lastMitarb++;
          monatList  .get(lastMonth)
          .getMitarbList()
          .get(lastMitarb)
          .getGehaltList()
          .add(new Gehaltrs.getDate("BuchungsDat"),
              rs.getDouble("gehaltausgezahlt.GehBrutto")+
                rs.getDouble("gehaltausgezahlt.sonstBezug")-
                rs.getDouble("gehaltausgezahlt.sonstAbzug"),
              rs.getDouble("gehaltausgezahlt.LSt")+
                rs.getDouble("gehaltausgezahlt.KiSt")+
                rs.getDouble("gehaltausgezahlt.Soli"),
              rs.getDouble("gehaltausgezahlt.RVAN")+
                rs.getDouble("gehaltausgezahlt.KVAN")+
                rs.getDouble("gehaltausgezahlt.ALVAN")+
                rs.getDouble("gehaltausgezahlt.PVAN"),
              rs.getDouble("gehaltausgezahlt.GehNetto"),
              rs.getDouble("gehaltausgezahlt.RVAG")+
                rs.getDouble("gehaltausgezahlt.KVAG")+
                rs.getDouble("gehaltausgezahlt.ALVAG")+
                rs.getDouble("gehaltausgezahlt.PVAG")));
        }else{
          monatList  .get(lastMonth)
          .getMitarbList()
          .get(lastMitarb)
          .getGehaltList()
          .add(new Gehaltrs.getDate("BuchungsDat"),
              rs.getDouble("gehaltausgezahlt.GehBrutto")+
                rs.getDouble("gehaltausgezahlt.sonstBezug")-
                rs.getDouble("gehaltausgezahlt.sonstAbzug"),
              rs.getDouble("gehaltausgezahlt.LSt")+
                rs.getDouble("gehaltausgezahlt.KiSt")+
                rs.getDouble("gehaltausgezahlt.Soli"),
              rs.getDouble("gehaltausgezahlt.RVAN")+
                rs.getDouble("gehaltausgezahlt.KVAN")+
                rs.getDouble("gehaltausgezahlt.ALVAN")+
                rs.getDouble("gehaltausgezahlt.PVAN"),
              rs.getDouble("gehaltausgezahlt.GehNetto"),
              rs.getDouble("gehaltausgezahlt.RVAG")+
                rs.getDouble("gehaltausgezahlt.KVAG")+
                rs.getDouble("gehaltausgezahlt.ALVAG")+
                rs.getDouble("gehaltausgezahlt.PVAG")));
        }
      }
    }
     
    int monat = startCal.get(Calendar.MONTH);
    int jahr = startCal.get(Calendar.YEAR);
     
    for(int j = 0; j < 3; j++){
     
      cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
      mySheet.addMergedRegion( cra );
     
      myFont = myWorkBook.createFont();
      myFont.setFontHeight((short) 240);
      myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

      gehaltNetto += monatList.get(i).getMonatGehaltNetto();
      sozVersAG += monatList.get(i).getMonatSozVersAG();
      gesamtkosten += monatList.get(i).getMonatGesamtkosten();
    }
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    mySheet.setDefaultColumnWidth(15);
    mySheet.setColumnWidth(0, 7000);
   
    myWorkBook.setSheetName(0, "F�nfjahresreport");

    cra = new CellRangeAddress(0, 0, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myRow = mySheet.createRow(0);
   
    myCell = myRow.createCell(0);
View Full Code Here

    double sozVersAN = 0;
    double gehaltNetto = 0;
    double sozVersAG = 0;
    double gesamtkosten = 0;
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.util.CellRangeAddress

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.