List of usage examples for org.apache.poi.ss.usermodel Sheet addMergedRegion
int addMergedRegion(CellRangeAddress region);
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportGenerator.java
License:Apache License
/** * For trados style// w w w. j a va 2 s.c o m * * @param p_sheet * @param p_sheetCategory * @param p_data * @param bundle * @throws Exception */ private void addHeaderTradosStyle(Workbook p_workbook, Sheet p_sheet, final int p_sheetCategory) throws Exception { String EMEA = CompanyWrapper.getCurrentCompanyName(); Row secRow = getRow(p_sheet, 1); Cell cell_Ldfl = getCell(secRow, 0); cell_Ldfl.setCellValue(m_bundle.getString("lb_desp_file_list")); cell_Ldfl.setCellStyle(getContentStyle(p_workbook)); int col = -1; Row thirRow = getRow(p_sheet, 2); Row fourRow = getRow(p_sheet, 3); // Company Name Cell cell_A = getCell(thirRow, ++col); cell_A.setCellValue(m_bundle.getString("lb_company_name")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); // Project Description Cell cell_B = getCell(thirRow, ++col); cell_B.setCellValue(m_bundle.getString("lb_project")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); if (isJobIdVisible) { Cell cell_C = getCell(thirRow, ++col); cell_C.setCellValue(m_bundle.getString("lb_job_id")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); } Cell cell_CorD = getCell(thirRow, ++col); cell_CorD.setCellValue(m_bundle.getString("lb_job_name")); cell_CorD.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_DorE = getCell(thirRow, ++col); cell_DorE.setCellValue(m_bundle.getString("lb_source_file_format")); cell_DorE.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_EorF = getCell(thirRow, ++col); cell_EorF.setCellValue(m_bundle.getString("lb_loc_profile")); cell_EorF.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_ForG = getCell(thirRow, ++col); cell_ForG.setCellValue(m_bundle.getString("lb_file_profiles")); cell_ForG.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_GorH = getCell(thirRow, ++col); cell_GorH.setCellValue(m_bundle.getString("lb_creation_date")); cell_GorH.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_HorI = getCell(thirRow, ++col); cell_HorI.setCellValue(m_bundle.getString("lb_creation_time")); cell_HorI.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_IorJ = getCell(thirRow, ++col); cell_IorJ.setCellValue(m_bundle.getString("lb_export_date")); cell_IorJ.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_JorK = getCell(thirRow, ++col); cell_JorK.setCellValue(m_bundle.getString("lb_export_time")); cell_JorK.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_KorL = getCell(thirRow, ++col); cell_KorL.setCellValue(m_bundle.getString("lb_status")); cell_KorL.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_LorM = getCell(thirRow, ++col); cell_LorM.setCellValue(m_bundle.getString("lb_lang")); cell_LorM.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); Cell cell_MorN_Header = getCell(thirRow, ++col); cell_MorN_Header.setCellValue(m_bundle.getString("lb_word_counts")); cell_MorN_Header.setCellStyle(getHeaderStyle(p_workbook)); if (m_data.useInContext) { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 7)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 7), getHeaderStyle(p_workbook)); } else { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 6)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 6), getHeaderStyle(p_workbook)); } Cell cell_MorN = getCell(fourRow, col); cell_MorN.setCellValue(m_bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_MorN.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_NorO = getCell(fourRow, col); cell_NorO.setCellValue(m_bundle.getString("lb_95_99")); cell_NorO.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_OorP = getCell(fourRow, col); cell_OorP.setCellValue(m_bundle.getString("lb_85_94")); cell_OorP.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_PorQ = getCell(fourRow, col); cell_PorQ.setCellValue(m_bundle.getString("lb_75_84") + "*"); cell_PorQ.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_QorR = getCell(fourRow, col); cell_QorR.setCellValue(m_bundle.getString("lb_no_match")); cell_QorR.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_RorS = getCell(fourRow, col); cell_RorS.setCellValue(m_bundle.getString("lb_repetition_word_cnt")); cell_RorS.setCellStyle(getHeaderStyle(p_workbook)); if (m_data.useInContext) { col++; Cell cell_InContext = getCell(fourRow, col); cell_InContext.setCellValue(m_bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } col++; Cell cell_Total = getCell(fourRow, col); cell_Total.setCellValue(m_bundle.getString("lb_total")); cell_Total.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_Invoice = getCell(thirRow, col); cell_Invoice.setCellValue(m_bundle.getString("jobinfo.tmmatches.invoice")); cell_Invoice.setCellStyle(getHeaderStyle(p_workbook)); if (p_sheetCategory == MONTH_SHEET) { if (m_data.useInContext) { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 9)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 9), getHeaderStyle(p_workbook)); } else { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 8)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 8), getHeaderStyle(p_workbook)); } Cell cell_Per100Matches = getCell(fourRow, col); cell_Per100Matches.setCellValue(m_bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_Per100Matches.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_95_99 = getCell(fourRow, col); cell_95_99.setCellValue(m_bundle.getString("lb_95_99")); cell_95_99.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_85_94 = getCell(fourRow, col); cell_85_94.setCellValue(m_bundle.getString("lb_85_94")); cell_85_94.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_75_84 = getCell(fourRow, col); cell_75_84.setCellValue(m_bundle.getString("lb_75_84") + "*"); cell_75_84.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_NoMatch = getCell(fourRow, col); cell_NoMatch.setCellValue(m_bundle.getString("lb_no_match")); cell_NoMatch.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_WordCount = getCell(fourRow, col); cell_WordCount.setCellValue(m_bundle.getString("lb_repetition_word_cnt")); cell_WordCount.setCellStyle(getHeaderStyle(p_workbook)); col++; if (m_data.useInContext) { Cell cell_InContext = getCell(fourRow, col); cell_InContext.setCellValue(m_bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); col++; } Cell cell_Total_Invoice = getCell(fourRow, col); cell_Total_Invoice.setCellValue(m_bundle.getString("jobinfo.tmmatches.wordcounts.total")); cell_Total_Invoice.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_AdditionalCharges = getCell(fourRow, col); cell_AdditionalCharges.setCellValue(m_bundle.getString("jobinfo.tmmatches.invoice.additionalCharges")); cell_AdditionalCharges.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_JobTotal = getCell(fourRow, col); cell_JobTotal.setCellValue(m_bundle.getString("jobinfo.tmmatches.invoice.jobtotal")); cell_JobTotal.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_Tracking = getCell(thirRow, col); cell_Tracking.setCellValue( m_bundle.getString("lb_tracking") + " " + EMEA + " " + m_bundle.getString("lb_use") + ")"); cell_Tracking.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); } else if (p_sheetCategory == MONTH_REVIEW_SHEET) { if (m_data.useInContext) { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 9)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 9), getHeaderStyle(p_workbook)); } else { p_sheet.addMergedRegion(new CellRangeAddress(2, 2, col, col + 7)); setRegionStyle(p_sheet, new CellRangeAddress(2, 2, col, col + 7), getHeaderStyle(p_workbook)); } Cell cell_Per100Matches = getCell(fourRow, col); cell_Per100Matches.setCellValue(m_bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_Per100Matches.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_95_99 = getCell(fourRow, col); cell_95_99.setCellValue(m_bundle.getString("lb_95_99")); cell_95_99.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_85_94 = getCell(fourRow, col); cell_85_94.setCellValue(m_bundle.getString("lb_85_94")); cell_85_94.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_75_84 = getCell(fourRow, col); cell_75_84.setCellValue(m_bundle.getString("lb_75_84")); cell_75_84.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_NoMatch = getCell(fourRow, col); cell_NoMatch.setCellValue(m_bundle.getString("lb_no_match")); cell_NoMatch.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_WoerCount = getCell(fourRow, col); cell_WoerCount.setCellValue(m_bundle.getString("lb_repetition_word_cnt")); cell_WoerCount.setCellStyle(getHeaderStyle(p_workbook)); col++; if (m_data.useInContext) { Cell cell_InContext = getCell(fourRow, col); cell_InContext.setCellValue(m_bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); col++; } Cell cell_TranTotal = getCell(fourRow, col); cell_TranTotal.setCellValue(m_bundle.getString("lb_translation_total")); cell_TranTotal.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_Review = getCell(fourRow, col); cell_Review.setCellValue(m_bundle.getString("lb_review")); cell_Review.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_JobTotal = getCell(fourRow, col); cell_JobTotal.setCellValue(m_bundle.getString("jobinfo.tmmatches.invoice.jobtotal")); cell_JobTotal.setCellStyle(getHeaderStyle(p_workbook)); col++; Cell cell_Tracking = getCell(thirRow, col); cell_Tracking.setCellValue( m_bundle.getString("lb_tracking") + " " + EMEA + " " + m_bundle.getString("lb_use") + ")"); cell_Tracking.setCellStyle(getHeaderStyle(p_workbook)); p_sheet.addMergedRegion(new CellRangeAddress(2, 3, col, col)); setRegionStyle(p_sheet, new CellRangeAddress(2, 3, col, col), getHeaderStyle(p_workbook)); } else { // Should never go here. } }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportGenerator.java
License:Apache License
/** * Add totals row/* ww w . ja v a2 s.c o m*/ * * @param p_sheet * @param p_sheetCategory * @param p_row * @param p_data * @param bundle * @throws Exception */ private void addTotals(Workbook p_workbook, Sheet p_sheet, final int p_sheetCategory, IntHolder p_row) throws Exception { int row = p_row.getValue() + 1; // skip a row String title = m_bundle.getString("lb_totals"); java.text.NumberFormat.getCurrencyInstance(Locale.US); // Get Summary Start Column int c = m_data.getSumStartCol(); String sumStartCol = getColumnName(c); Row theRow = getRow(p_sheet, row); Cell cell_A = getCell(theRow, 0); cell_A.setCellValue(title); cell_A.setCellStyle(getSubTotalStyle(p_workbook)); // modify the number 3 to "sumStartCellCol-B" for "Add Job Id into // online job report" issue p_sheet.addMergedRegion(new CellRangeAddress(row, row, 0, sumStartCol.charAt(0) - 'B')); setRegionStyle(p_sheet, new CellRangeAddress(row, row, 0, sumStartCol.charAt(0) - 'B'), getSubTotalStyle(p_workbook)); int lastRow = p_row.getValue() - 2; // add in word count totals // word counts Cell cell_B = getCell(theRow, c++); cell_B.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_B.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_C = getCell(theRow, c++); cell_C.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_C.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_D = getCell(theRow, c++); cell_D.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_D.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_E = getCell(theRow, c++); cell_E.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_E.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_F = getCell(theRow, c++); cell_F.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_F.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); if (m_data.isTradosStyle()) { Cell cell_G = getCell(theRow, c++); cell_G.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_G.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_H = getCell(theRow, c++); cell_H.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_H.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); } if (m_data.useInContext) { Cell cell_InContext = getCell(theRow, c++); cell_InContext.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_InContext.setCellStyle(getSubTotalStyle(p_workbook)); sumStartCol = getColumnName(c); } // word count costs Cell cell_K = getCell(theRow, c++); cell_K.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_K.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_L = getCell(theRow, c++); cell_L.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_L.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_M = getCell(theRow, c++); cell_M.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_M.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_N = getCell(theRow, c++); cell_N.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_N.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_O = getCell(theRow, c++); cell_O.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_O.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_P = getCell(theRow, c++); cell_P.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_P.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_Q = getCell(theRow, c++); cell_Q.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_Q.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); if (m_data.isTradosStyle()) { Cell cell_R = getCell(theRow, c++); cell_R.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_R.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); Cell cell_S = getCell(theRow, c++); cell_S.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_S.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); } if (m_data.useInContext) { Cell cell_InContext = getCell(theRow, c++); cell_InContext.setCellFormula("SUM(" + sumStartCol + "5:" + sumStartCol + lastRow + ")"); cell_InContext.setCellStyle(getTotalMoneyStyle(p_workbook)); sumStartCol = getColumnName(c); } // add an extra column for Dell Tracking Use Cell cell_V = getCell(theRow, c++); cell_V.setCellValue(""); cell_V.setCellStyle(getTotalMoneyStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.SummaryReportGenerator.java
License:Apache License
/** * Creates Monthly Sheet//from w w w .j a va 2 s. c o m */ private void createMonthlySheet(Workbook p_workbook, Sheet p_sheet, ReportSearchOptions p_options, Map<String, ReportWordCount> p_wordCounts) throws Exception { List<String> searchMonths = p_options.getMonths(); CellStyle style = getHeaderStyle(p_workbook); CellStyle style1 = getHeaderStyle(p_workbook, null, null, null, null); CellStyle styleTB = getHeaderStyle(p_workbook, CellStyle.BORDER_THIN, null, CellStyle.BORDER_THIN, null); CellStyle styleTB2 = getHeaderStyle(p_workbook, CellStyle.BORDER_THIN, null, CellStyle.BORDER_THIN, null); styleTB2.setAlignment(CellStyle.ALIGN_RIGHT); CellStyle styleLR = getHeaderStyle(p_workbook, null, CellStyle.BORDER_THIN, null, CellStyle.BORDER_THIN); int row = ROWNUMBER, column = 0; p_sheet.setColumnWidth(0, 12 * 256); Cell cell_A_Header = getCell(getRow(p_sheet, row), column++); cell_A_Header.setCellValue(bundle.getString("lb_sumOfTotal")); cell_A_Header.setCellStyle(style); p_sheet.addMergedRegion(new CellRangeAddress(row, row, column, column + searchMonths.size())); setRegionStyle(p_sheet, new CellRangeAddress(row, row, column, column + searchMonths.size()), style); Cell cell_B_Header = getCell(getRow(p_sheet, row), column); cell_B_Header.setCellValue(bundle.getString("lb_month")); cell_B_Header.setCellStyle(style); row++; column = 0; Cell cell_A = getCell(getRow(p_sheet, row), column++); cell_A.setCellValue(bundle.getString("lb_lang")); cell_A.setCellStyle(style); for (String yearAndMonth : searchMonths) { Cell cell_Month = getCell(getRow(p_sheet, row), column++); cell_Month.setCellValue(Double.valueOf(yearAndMonth.substring(4))); cell_Month.setCellStyle(styleTB); } p_sheet.setColumnWidth(column, 10 * 256); Cell cell_LocaleTotal = getCell(getRow(p_sheet, row), column++); cell_LocaleTotal.setCellValue(bundle.getString("lb_grandTotal")); cell_LocaleTotal.setCellStyle(style); // Adds a hidden column, for Excel Sum Check Error. Row hiddenRow = getRow(p_sheet, ++row); hiddenRow.setZeroHeight(isHidden); getRow(p_sheet, row - 1).setHeight(p_sheet.getDefaultRowHeight()); int dataRow = ++row; column = 0; double totalWordCount = 0; Set<String> locales = getLocals(p_wordCounts); for (String locale : locales) { Cell cell_A_Locale = getCell(getRow(p_sheet, row), column++); cell_A_Locale.setCellValue(locale); cell_A_Locale.setCellStyle(styleLR); for (String yearAndMonth : searchMonths) { ReportWordCount reportWordCount = p_wordCounts.get(getWordCountMapKey(locale, yearAndMonth)); if (reportWordCount != null) { totalWordCount = reportWordCount.getTradosTotalWordCount(); } addNumberCell(p_sheet, column++, row, totalWordCount, style1); totalWordCount = 0; } Cell cell_LocaleTotal_Month = getCell(getRow(p_sheet, row), column); cell_LocaleTotal_Month.setCellFormula(getSumOfRow(1, column - 1, row)); cell_LocaleTotal_Month.setCellStyle(styleLR); row++; column = 0; } if (row > (ROWNUMBER + 3)) { column = 0; Cell cell_GrandTotal = getCell(getRow(p_sheet, row), column++); cell_GrandTotal.setCellValue(bundle.getString("lb_grandTotal")); cell_GrandTotal.setCellStyle(style); for (int i = 0; i < searchMonths.size(); i++) { Cell cell_MonthTotal = getCell(getRow(p_sheet, row), column); cell_MonthTotal.setCellFormula(getSumOfColumn(dataRow, row - 1, column)); cell_MonthTotal.setCellStyle(styleTB); column++; } Cell cell_Total = getCell(getRow(p_sheet, row), column); cell_Total.setCellFormula(getSumOfColumn(dataRow, row - 1, column)); cell_Total.setCellStyle(style); } }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
/** * Adds the table header for the Dell Matches sheet * //from w w w .j av a2s. c om */ private void addHeaderForDellMatches(Workbook p_workbook) throws Exception { Sheet theSheet = data.dellSheet; int c = 0; Row headerRow = getRow(theSheet, 2); Cell cell_A = getCell(headerRow, c); cell_A.setCellValue(bundle.getString("lb_job_id")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_B = getCell(headerRow, c); cell_B.setCellValue(bundle.getString("lb_job_name")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_C = getCell(headerRow, c); cell_C.setCellValue(bundle.getString("lb_po_number_report")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_D = getCell(headerRow, c); cell_D.setCellValue(bundle.getString("lb_description")); cell_D.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_E = getCell(headerRow, c); cell_E.setCellValue(bundle.getString("lb_creation_date")); cell_E.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_F = getCell(headerRow, c); cell_F.setCellValue(bundle.getString("lb_activity_name")); cell_F.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 20 * 256); c++; Cell cell_G = getCell(headerRow, c); cell_G.setCellValue(bundle.getString("lb_accepted_reviewer_date")); cell_G.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_H = getCell(headerRow, c); cell_H.setCellValue(bundle.getString("lb_lang")); cell_H.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_I = getCell(headerRow, c); cell_I.setCellValue(bundle.getString("lb_word_count")); cell_I.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_J = getCell(headerRow, c); cell_J.setCellValue(bundle.getString("jobinfo.tmmatches.invoice")); cell_J.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_K = getCell(headerRow, c); cell_K.setCellValue(bundle.getString("lb_tracking")); cell_K.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
/** * Adds the table header for the Trados Matches sheet * // w w w .j a v a 2 s . co m */ private void addHeaderForTradosMatches(Workbook p_workbook) throws Exception { Sheet theSheet = data.tradosSheet; int c = 0; Row secRow = getRow(theSheet, 1); Row thirRow = getRow(theSheet, 2); Row fourRow = getRow(theSheet, 3); Cell cell_Ldfl = getCell(secRow, 0); cell_Ldfl.setCellValue(bundle.getString("lb_desp_file_list")); cell_Ldfl.setCellStyle(getContentStyle(p_workbook)); Cell cell_A = getCell(thirRow, c); cell_A.setCellValue(bundle.getString("lb_job_id")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_B = getCell(thirRow, c); cell_B.setCellValue(bundle.getString("lb_job")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_C = getCell(thirRow, c); cell_C.setCellValue(bundle.getString("lb_po_number_report")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_D = getCell(thirRow, c); cell_D.setCellValue(bundle.getString("lb_description")); cell_D.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_E = getCell(thirRow, c); cell_E.setCellValue(bundle.getString("lb_creation_date")); cell_E.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_F = getCell(thirRow, c); cell_F.setCellValue(bundle.getString("lb_lang")); cell_F.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_G_Header = getCell(thirRow, c); cell_G_Header.setCellValue(bundle.getString("lb_word_counts")); cell_G_Header.setCellStyle(getHeaderStyle(p_workbook)); if (data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 7)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 7), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 6)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 6), getHeaderStyle(p_workbook)); } Cell cell_G = getCell(fourRow, c++); cell_G.setCellValue(bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_G.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_H = getCell(fourRow, c++); cell_H.setCellValue(bundle.getString("lb_95_99")); cell_H.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_I = getCell(fourRow, c++); cell_I.setCellValue(bundle.getString("lb_85_94")); cell_I.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_J = getCell(fourRow, c++); cell_J.setCellValue(bundle.getString("lb_75_84") + "*"); cell_J.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_K = getCell(fourRow, c++); cell_K.setCellValue(bundle.getString("lb_no_match")); cell_K.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_L = getCell(fourRow, c++); cell_L.setCellValue(bundle.getString("lb_repetition_word_cnt")); cell_L.setCellStyle(getHeaderStyle(p_workbook)); if (data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_Total = getCell(fourRow, c++); cell_Total.setCellValue(bundle.getString("lb_total")); cell_Total.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Invoice = getCell(thirRow, c); cell_Invoice.setCellValue(bundle.getString("jobinfo.tmmatches.invoice")); cell_Invoice.setCellStyle(getHeaderStyle(p_workbook)); if (data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 9)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 9), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 8)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 8), getHeaderStyle(p_workbook)); } Cell cell_Per100Matches = getCell(fourRow, c++); cell_Per100Matches.setCellValue(bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_Per100Matches.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_95_99 = getCell(fourRow, c++); cell_95_99.setCellValue(bundle.getString("lb_95_99")); cell_95_99.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_85_94 = getCell(fourRow, c++); cell_85_94.setCellValue(bundle.getString("lb_85_94")); cell_85_94.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_75_84 = getCell(fourRow, c++); cell_75_84.setCellValue(bundle.getString("lb_75_84") + "*"); cell_75_84.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_NoMatch = getCell(fourRow, c++); cell_NoMatch.setCellValue(bundle.getString("lb_no_match")); cell_NoMatch.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Repetition = getCell(fourRow, c++); cell_Repetition.setCellValue(bundle.getString("lb_repetition_word_cnt")); cell_Repetition.setCellStyle(getHeaderStyle(p_workbook)); if (data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_Total_Invoice = getCell(fourRow, c++); cell_Total_Invoice.setCellValue(bundle.getString("lb_translation_total")); cell_Total_Invoice.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Review = getCell(fourRow, c++); cell_Review.setCellValue(bundle.getString("lb_review")); cell_Review.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_JobTotal = getCell(fourRow, c++); cell_JobTotal.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.jobtotal")); cell_JobTotal.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Tracking = getCell(thirRow, c); cell_Tracking.setCellValue(bundle.getString("lb_tracking")); cell_Tracking.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
/** Adds totals */ private void addTotalsForDellMatches(Workbook p_workbook, IntHolder p_row) throws Exception { Sheet theSheet = data.dellSheet; // Totals/*from w w w . j a v a 2s.c om*/ int totalsRow = p_row.getValue() + 1; // skip a row Row totalRow = getRow(theSheet, totalsRow); Cell cell_A = getCell(totalRow, 0); cell_A.setCellValue(bundle.getString("lb_totals")); cell_A.setCellStyle(getSubTotalStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(totalsRow, totalsRow, 0, 7)); setRegionStyle(theSheet, new CellRangeAddress(totalsRow, totalsRow, 0, 7), getSubTotalStyle(p_workbook)); int lastRow = p_row.getValue() - 2; int c = 8; // Word Count Cell cell_I = getCell(totalRow, c++); cell_I.setCellFormula("SUM(I5" + ":I" + lastRow + ")"); cell_I.setCellStyle(getSubTotalStyle(p_workbook)); // Invoice Cell cell_J = getCell(totalRow, c++); cell_J.setCellFormula("SUM(J5" + ":J" + lastRow + ")"); cell_J.setCellStyle(getTotalMoneyStyle(p_workbook)); // add an extra column for Dell Tracking Use Cell cell_K = getCell(totalRow, c++); cell_K.setCellValue(""); cell_K.setCellStyle(getTotalMoneyStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
/** Adds the totals and sub-total formulas */ private void addTotalsForTradosMatches(Workbook p_workbook, IntHolder p_row) throws Exception { Sheet theSheet = data.tradosSheet; int row = p_row.getValue() + 1; // skip a row String title = bundle.getString("lb_totals"); Row totalRow = getRow(theSheet, row); Cell cell_A = getCell(totalRow, 0);//from w w w.j a v a2 s. c o m cell_A.setCellValue(title); cell_A.setCellStyle(getSubTotalStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(row, row, 0, 5)); setRegionStyle(theSheet, new CellRangeAddress(row, row, 0, 5), getSubTotalStyle(p_workbook)); int lastRow = p_row.getValue() - 2; // add in word count totals int c = 6; // word counts if (data.headers[0] != null) { Cell cell_G = getCell(totalRow, c++); cell_G.setCellFormula("SUM(G5:G" + lastRow + ")"); cell_G.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_H = getCell(totalRow, c++); cell_H.setCellFormula("SUM(H5:H" + lastRow + ")"); cell_H.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_I = getCell(totalRow, c++); cell_I.setCellFormula("SUM(I5:I" + lastRow + ")"); cell_I.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_J = getCell(totalRow, c++); cell_J.setCellFormula("SUM(J5:J" + lastRow + ")"); cell_J.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_K = getCell(totalRow, c++); cell_K.setCellFormula("SUM(K5:K" + lastRow + ")"); cell_K.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_L = getCell(totalRow, c++); cell_L.setCellFormula("SUM(L5:L" + lastRow + ")"); cell_L.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_M = getCell(totalRow, c++); cell_M.setCellFormula("SUM(M5:M" + lastRow + ")"); cell_M.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_N = getCell(totalRow, c++); cell_N.setCellFormula("SUM(N5:N" + lastRow + ")"); cell_N.setCellStyle(getSubTotalStyle(p_workbook)); // word count costs Cell cell_O = getCell(totalRow, c++); cell_O.setCellFormula("SUM(O5:O" + lastRow + ")"); cell_O.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_P = getCell(totalRow, c++); cell_P.setCellFormula("SUM(P5:P" + lastRow + ")"); cell_P.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_Q = getCell(totalRow, c++); cell_Q.setCellFormula("SUM(Q5:Q" + lastRow + ")"); cell_Q.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_R = getCell(totalRow, c++); cell_R.setCellFormula("SUM(R5:R" + lastRow + ")"); cell_R.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_S = getCell(totalRow, c++); cell_S.setCellFormula("SUM(S5:S" + lastRow + ")"); cell_S.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_T = getCell(totalRow, c++); cell_T.setCellFormula("SUM(T5:T" + lastRow + ")"); cell_T.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_U = getCell(totalRow, c++); cell_U.setCellFormula("SUM(U5:U" + lastRow + ")"); cell_U.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_V = getCell(totalRow, c++); cell_V.setCellFormula("SUM(V5:V" + lastRow + ")"); cell_V.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_W = getCell(totalRow, c++); cell_W.setCellFormula("SUM(W5:W" + lastRow + ")"); cell_W.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_X = getCell(totalRow, c++); cell_X.setCellFormula("SUM(X5:X" + lastRow + ")"); cell_X.setCellStyle(getTotalMoneyStyle(p_workbook)); } else { Cell cell_G = getCell(totalRow, c++); cell_G.setCellFormula("SUM(G5:G" + lastRow + ")"); cell_G.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_H = getCell(totalRow, c++); cell_H.setCellFormula("SUM(H5:H" + lastRow + ")"); cell_H.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_I = getCell(totalRow, c++); cell_I.setCellFormula("SUM(I5:I" + lastRow + ")"); cell_I.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_J = getCell(totalRow, c++); cell_J.setCellFormula("SUM(J5:J" + lastRow + ")"); cell_J.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_K = getCell(totalRow, c++); cell_K.setCellFormula("SUM(K5:K" + lastRow + ")"); cell_K.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_L = getCell(totalRow, c++); cell_L.setCellFormula("SUM(L5:L" + lastRow + ")"); cell_L.setCellStyle(getSubTotalStyle(p_workbook)); Cell cell_M = getCell(totalRow, c++); cell_M.setCellFormula("SUM(M5:M" + lastRow + ")"); cell_M.setCellStyle(getSubTotalStyle(p_workbook)); // word count costs Cell cell_N = getCell(totalRow, c++); cell_N.setCellFormula("SUM(N5:N" + lastRow + ")"); cell_N.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_O = getCell(totalRow, c++); cell_O.setCellFormula("SUM(O5:O" + lastRow + ")"); cell_O.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_P = getCell(totalRow, c++); cell_P.setCellFormula("SUM(P5:P" + lastRow + ")"); cell_P.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_Q = getCell(totalRow, c++); cell_Q.setCellFormula("SUM(Q5:Q" + lastRow + ")"); cell_Q.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_R = getCell(totalRow, c++); cell_R.setCellFormula("SUM(R5:R" + lastRow + ")"); cell_R.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_S = getCell(totalRow, c++); cell_S.setCellFormula("SUM(S5:S" + lastRow + ")"); cell_S.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_T = getCell(totalRow, c++); cell_T.setCellFormula("SUM(T5:T" + lastRow + ")"); cell_T.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_U = getCell(totalRow, c++); cell_U.setCellFormula("SUM(U5:U" + lastRow + ")"); cell_U.setCellStyle(getTotalMoneyStyle(p_workbook)); Cell cell_V = getCell(totalRow, c++); cell_V.setCellFormula("SUM(V5:V" + lastRow + ")"); cell_V.setCellStyle(getTotalMoneyStyle(p_workbook)); } // add an extra column for Dell Tracking Use Cell cell_Last = getCell(totalRow, c++); cell_Last.setCellValue(""); cell_Last.setCellStyle(getTotalMoneyStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.SlaXlsReportHelper.java
License:Apache License
/** * Adds the table header for the Dell Matches sheet * //from w ww .j av a2 s . c om */ private void addHeader(Workbook p_workbook) throws Exception { Sheet theSheet = data.generalSheet; int c = 0; Row headerRow = getRow(theSheet, 2); Cell cell_A = getCell(headerRow, c); cell_A.setCellValue(bundle.getString("lb_job_id")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 7 * 256); c++; Cell cell_B = getCell(headerRow, c); cell_B.setCellValue(bundle.getString("lb_job_name")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 40 * 256); c++; Cell cell_C = getCell(headerRow, c); cell_C.setCellValue(bundle.getString("lb_workflow")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 25 * 256); c++; Cell cell_D = getCell(headerRow, c); cell_D.setCellValue(bundle.getString("lb_language")); cell_D.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 12 * 256); c++; Cell cell_E = getCell(headerRow, c); cell_E.setCellValue(bundle.getString("lb_word_count")); cell_E.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 7 * 256); c++; Cell cell_F = getCell(headerRow, c); cell_F.setCellValue(bundle.getString("lb_current_activity")); cell_F.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 14 * 256); c++; Cell cell_G = getCell(headerRow, c); cell_G.setCellValue(bundle.getString("lb_translation_start_date")); cell_G.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 28 * 256); c++; Cell cell_H = getCell(headerRow, c); cell_H.setCellValue(bundle.getString("lb_translation_due_date")); cell_H.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 28 * 256); c++; Cell cell_I = getCell(headerRow, c); cell_I.setCellValue(bundle.getString("lb_translation_finish_date")); cell_I.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 28 * 256); c++; Cell cell_J = getCell(headerRow, c); cell_J.setCellValue(bundle.getString("lb_on_time")); cell_J.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 28 * 256); c++; Cell cell_K = getCell(headerRow, c); cell_K.setCellValue(bundle.getString("lb_leadtime")); cell_K.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 12 * 256); c++; Cell cell_L = getCell(headerRow, c); cell_L.setCellValue(bundle.getString("lb_actual_performance")); cell_L.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 14 * 256); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.VendorPOXlsReport.java
License:Apache License
/** * Adds the table header for the Dell Matches sheet * /*from w ww . j av a 2s .c o m*/ */ private void addHeaderForDellMatches(Workbook p_workbook, MyData p_data) throws Exception { Sheet theSheet = p_data.dellSheet; int c = 0; Row thirRow = getRow(theSheet, 2); Row fourRow = getRow(theSheet, 3); Cell cell_A = getCell(thirRow, c); cell_A.setCellValue(bundle.getString("lb_job_id")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_B = getCell(thirRow, c); cell_B.setCellValue(bundle.getString("lb_job")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_C = getCell(thirRow, c); cell_C.setCellValue(bundle.getString("lb_po_number_report")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_D = getCell(thirRow, c); cell_D.setCellValue(bundle.getString("lb_description")); cell_D.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_E = getCell(thirRow, c); cell_E.setCellValue(bundle.getString("lb_creation_date")); cell_E.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_F = getCell(thirRow, c); cell_F.setCellValue(bundle.getString("lb_lang")); cell_F.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_G_Header = getCell(thirRow, c); cell_G_Header.setCellValue(bundle.getString("lb_word_counts")); cell_G_Header.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 5)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 5), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 4)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 4), getHeaderStyle(p_workbook)); } Cell cell_G = getCell(fourRow, c++); cell_G.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts.internalreps")); cell_G.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_H = getCell(fourRow, c++); cell_H.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts.exactmatches")); cell_H.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts.incontextmatches")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_FuzzyMatches = getCell(fourRow, c++); cell_FuzzyMatches.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts.fuzzymatches")); cell_FuzzyMatches.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Newwords = getCell(fourRow, c++); cell_Newwords.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts.newwords")); cell_Newwords.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Total = getCell(fourRow, c++); cell_Total.setCellValue(bundle.getString("lb_total")); cell_Total.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Invoice = getCell(thirRow, c); cell_Invoice.setCellValue(bundle.getString("jobinfo.tmmatches.invoice")); cell_Invoice.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 5)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 5), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 4)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 4), getHeaderStyle(p_workbook)); } Cell cell_InternalReps = getCell(fourRow, c++); cell_InternalReps.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.internalreps")); cell_InternalReps.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_ExactMatches = getCell(fourRow, c++); cell_ExactMatches.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.exactmatches")); cell_ExactMatches.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.incontextmatches")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_FuzzyMatches_Invoice = getCell(fourRow, c++); cell_FuzzyMatches_Invoice.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.fuzzymatches")); cell_FuzzyMatches_Invoice.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_NewWords_Invoice = getCell(fourRow, c++); cell_NewWords_Invoice.setCellValue(bundle.getString("jobinfo.tmmatches.invoice.newwords")); cell_NewWords_Invoice.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Total_Invoice = getCell(fourRow, c++); cell_Total_Invoice.setCellValue(bundle.getString("lb_total")); cell_Total_Invoice.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getContentStyle(p_workbook)); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.VendorPOXlsReport.java
License:Apache License
/** * Adds the table header for the Trados Matches sheet * // ww w.ja v a 2s .c o m */ private void addHeaderForTradosMatches(Workbook p_workbook, MyData p_data) throws Exception { Sheet theSheet = p_data.tradosSheet; int c = 0; Row secRow = getRow(theSheet, 1); Row thirRow = getRow(theSheet, 2); Row fourRow = getRow(theSheet, 3); Cell cell_Ldfl = getCell(secRow, c); cell_Ldfl.setCellValue(bundle.getString("lb_desp_file_list")); cell_Ldfl.setCellStyle(getContentStyle(p_workbook)); Cell cell_A = getCell(thirRow, c); cell_A.setCellValue(bundle.getString("lb_job_id")); cell_A.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_B = getCell(thirRow, c); cell_B.setCellValue(bundle.getString("lb_job")); cell_B.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_C = getCell(thirRow, c); cell_C.setCellValue(bundle.getString("lb_po_number_report")); cell_C.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_D = getCell(thirRow, c); cell_D.setCellValue(bundle.getString("reportDesc")); cell_D.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); theSheet.setColumnWidth(c, 15 * 256); c++; Cell cell_E = getCell(thirRow, c); cell_E.setCellValue(bundle.getString("lb_creation_date")); cell_E.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_F = getCell(thirRow, c); cell_F.setCellValue(bundle.getString("lb_lang")); cell_F.setCellStyle(getHeaderStyle(p_workbook)); theSheet.addMergedRegion(new CellRangeAddress(2, 3, c, c)); setRegionStyle(theSheet, new CellRangeAddress(2, 3, c, c), getHeaderStyle(p_workbook)); c++; Cell cell_G_Header = getCell(thirRow, c); cell_G_Header.setCellValue(bundle.getString("jobinfo.tmmatches.wordcounts")); cell_G_Header.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 7)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 7), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 6)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 6), getHeaderStyle(p_workbook)); } Cell cell_G = getCell(fourRow, c++); cell_G.setCellValue(bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_G.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_H = getCell(fourRow, c++); cell_H.setCellValue(bundle.getString("lb_95_99")); cell_H.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_I = getCell(fourRow, c++); cell_I.setCellValue(bundle.getString("lb_85_94")); cell_I.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_J = getCell(fourRow, c++); cell_J.setCellValue(bundle.getString("lb_75_84") + "*"); cell_J.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_K = getCell(fourRow, c++); cell_K.setCellValue(bundle.getString("lb_no_match")); cell_K.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_L = getCell(fourRow, c++); cell_L.setCellValue(bundle.getString("lb_repetition_word_cnt")); cell_L.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("lb_in_context_tm")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_Total = getCell(fourRow, c++); cell_Total.setCellValue(bundle.getString("lb_total")); cell_Total.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Invoice = getCell(thirRow, c); cell_Invoice.setCellValue(bundle.getString("jobinfo.tmmatches.invoice")); cell_Invoice.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 7)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 7), getHeaderStyle(p_workbook)); } else { theSheet.addMergedRegion(new CellRangeAddress(2, 2, c, c + 6)); setRegionStyle(theSheet, new CellRangeAddress(2, 2, c, c + 6), getHeaderStyle(p_workbook)); } Cell cell_Per100Matches = getCell(fourRow, c++); cell_Per100Matches.setCellValue(bundle.getString("jobinfo.tradosmatches.invoice.per100matches")); cell_Per100Matches.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_95_99 = getCell(fourRow, c++); cell_95_99.setCellValue(bundle.getString("lb_95_99")); cell_95_99.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_85_94 = getCell(fourRow, c++); cell_85_94.setCellValue(bundle.getString("lb_85_94")); cell_85_94.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_75_84 = getCell(fourRow, c++); cell_75_84.setCellValue(bundle.getString("lb_75_84") + "*"); cell_75_84.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_NoMatch = getCell(fourRow, c++); cell_NoMatch.setCellValue(bundle.getString("lb_no_match")); cell_NoMatch.setCellStyle(getHeaderStyle(p_workbook)); Cell cell_Repetition = getCell(fourRow, c++); cell_Repetition.setCellValue(bundle.getString("lb_repetition_word_cnt")); cell_Repetition.setCellStyle(getHeaderStyle(p_workbook)); if (p_data.headers[0] != null) { Cell cell_InContext = getCell(fourRow, c++); cell_InContext.setCellValue(bundle.getString("lb_in_context_match")); cell_InContext.setCellStyle(getHeaderStyle(p_workbook)); } Cell cell_Total_Invoice = getCell(fourRow, c++); cell_Total_Invoice.setCellValue(bundle.getString("lb_total")); cell_Total_Invoice.setCellStyle(getHeaderStyle(p_workbook)); }