List of usage examples for org.apache.poi.hssf.usermodel HSSFRow getCell
@Override public HSSFCell getCell(int cellnum)
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen aller Benutzer/*ww w. j a v a 2 s .c o m*/ * * @param workbook - das Workbook * @param key_sheet_players - der Key fr das Sheet */ public static void parseUsers(HSSFWorkbook workbook, String key_sheet_players) { HSSFSheet sheet_players = workbook.getSheet(key_sheet_players); HSSFRow row; Cell cell; String username, rolename, username1, username2; String playerrole, userrole; Player player; // sheet_players -> erstelle alle Benutzer int rowNum = 1; while ((row = sheet_players.getRow(rowNum++)) != null) { try { username = row.getCell(0).getStringCellValue(); if (username == null || username.isEmpty()) break; rolename = row.getCell(1).getStringCellValue(); if (rolename.contains("NORMAL")) { playerrole = BaseGameConstants.ROLE_NORMAL_PLAYER; userrole = BaseApplicationConstants.ROLE_NORMAL_USER; } else if (rolename.contains("MODERATOR")) { playerrole = BaseGameConstants.ROLE_PREMIUM_PLAYER; userrole = BaseApplicationConstants.ROLE_MODERATOR; } else if (rolename.contains("ADMIN")) { playerrole = BaseGameConstants.ROLE_PREMIUM_PLAYER; userrole = BaseApplicationConstants.ROLE_ADMIN; } else // if (rolename.contains("DEMO")) { playerrole = BaseGameConstants.ROLE_DEMO_PLAYER; userrole = BaseApplicationConstants.ROLE_DEMO_USER; } getOrCreatePlayer(username, playerrole, userrole); } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_players + " at line " + rowNum); } } logger.debug("players created: " + players.size()); rowNum = 1; int colNum; int count = 0, sittercount = 0; boolean sitter1, sitter2; while ((row = sheet_players.getRow(rowNum++)) != null) { try { colNum = rowNum + 1; username1 = row.getCell(0).getStringCellValue(); if (username1 == null || username1.isEmpty()) break; while ((cell = sheet_players.getRow(0).getCell(colNum++)) != null) { username2 = cell.getStringCellValue(); if (username2 == null || username2.isEmpty()) break; sitter1 = (row.getCell(colNum - 1) != null && row.getCell(colNum - 1).getNumericCellValue() == 1); sitter2 = (sheet_players.getRow(colNum - 2).getCell(rowNum) != null && sheet_players.getRow(colNum - 2).getCell(rowNum).getNumericCellValue() == 1); if (sitter1 || sitter2) { RandomModels.createUserContact(getOrCreatePlayer(username1, null, null).getUser(), getOrCreatePlayer(username2, null, null).getUser()); count++; } if (sitter1) { player = getOrCreatePlayer(username1, null, null); player.getSitters().add(getOrCreatePlayer(username2, null, null)); player = playerManager.save(player); players.put(username1, player); sittercount++; } if (sitter2) { player = getOrCreatePlayer(username2, null, null); player.getSitters().add(getOrCreatePlayer(username1, null, null)); player = playerManager.save(player); players.put(username2, player); sittercount++; } } } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_players + " at line " + rowNum); } } logger.debug("user-contacts created: " + count); logger.debug("user-sitters created: " + sittercount); }
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen aller Imperien/*from ww w . j a v a 2 s. co m*/ * * @param workbook - das Workbook * @param key_sheet_empires - der Key fr das Sheet */ public static void parseEmpires(HSSFWorkbook workbook, String key_sheet_empires) { HSSFSheet sheet_empires = workbook.getSheet(key_sheet_empires); HSSFRow row; String empirename, playername; Player player; Empire empire; int blocks, colonies, x, y, z, r, level; // sheet_empires -> erstelle alle Imperien int rowNum = 1; while ((row = sheet_empires.getRow(rowNum++)) != null) { try { empirename = row.getCell(0).getStringCellValue(); if (empirename == null || empirename.isEmpty()) break; playername = row.getCell(1).getStringCellValue(); blocks = (int) row.getCell(2).getNumericCellValue(); colonies = (int) row.getCell(3).getNumericCellValue(); x = (int) row.getCell(4).getNumericCellValue(); y = (int) row.getCell(5).getNumericCellValue(); z = (int) row.getCell(6).getNumericCellValue(); r = (int) row.getCell(7).getNumericCellValue(); level = (int) row.getCell(8).getNumericCellValue(); logger.debug( "creating empire: " + empirename + " [player = " + playername + "]" + " blocks/colonies=" + blocks + "/" + colonies + " @ (" + x + "|" + y + "|" + z + ") r=" + r); player = getOrCreatePlayer(playername, null, null); empire = getOrCreateEmpire(empirename, player, blocks, colonies, x, y, z, r, level); if (player.getCurrentEmpire() == null) { player.setCurrentEmpire(empire); player = playerManager.save(player); players.put(playername, player); } } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_empires + " at line " + rowNum); } } logger.debug("empires created: " + empires.size()); }
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen aller Allianzen und der Mitgliedschaften * // w ww .j a v a 2s . c om * @param workbook - das Workbook * @param key_sheet_allianceMemberships - der Key fr das Sheet */ public static void parseAlliancesMemberships(HSSFWorkbook workbook, String key_sheet_allianceMemberships) { HSSFSheet sheet_allianceMemberships = workbook.getSheet(key_sheet_allianceMemberships); HSSFRow row; Cell cell; String alliancename, empirename, name, fullname; Alliance alliance; AllianceRank allianceRank; Empire empire; EmpireRank empireRank; int rowNum; List<Empire> members; // sheet_allianceMemberships -> Allianzen und Mitgliedschaften erstellen int colNum = 1; while ((cell = sheet_allianceMemberships.getRow(0).getCell(colNum++)) != null) { try { alliancename = cell.getStringCellValue(); logger.debug("creating alliance: " + alliancename); alliance = getOrCreateAlliance(alliancename); logger.debug("alliance has " + alliance.getAllianceMemberRanks().size() + " ranks"); members = new LinkedList<Empire>(); // Mitglieder den Rngen zuweisen rowNum = 1; while ((row = sheet_allianceMemberships.getRow(rowNum++)) != null) { empirename = row.getCell(0).getStringCellValue(); if (empirename == null || empirename.isEmpty()) break; empire = getOrCreateEmpire(empirename, null); name = row.getCell(colNum - 1).getStringCellValue(); fullname = allianceMemberRanks.get(name + "_full"); if (fullname != null) { members.add(empire); logger.debug("empire '" + empirename + "' has rank '" + name + "' ('" + fullname + "')"); for (AllianceMemberRank rank : alliance.getAllianceMemberRanks()) { if (rank.getRankName().equals(fullname)) { rank.getEmpires().add(empire); break; } } } } for (AllianceMemberRank rank : alliance.getAllianceMemberRanks()) { allianceMemberRankManager.save(rank); } logger.debug("alliance has " + members.size() + " members"); allianceRank = (AllianceRank) allianceRankManager.getByEntity(alliance.getId()); for (Empire member : members) { empireRank = (EmpireRank) empireRankManager.getByEntity(member.getId()); allianceRank.setEconomy(allianceRank.getEconomy() + empireRank.getEconomy()); allianceRank.setMilitary(allianceRank.getMilitary() + empireRank.getMilitary()); allianceRank.setScience(allianceRank.getScience() + empireRank.getScience()); allianceRank.setTotal(allianceRank.getTotal() + empireRank.getTotal()); } allianceRank.setNumberOfEmpires(members.size()); allianceRank.setAverageEconomy(allianceRank.getEconomy() / allianceRank.getNumberOfEmpires()); allianceRank.setAverageMilitary(allianceRank.getMilitary() / allianceRank.getNumberOfEmpires()); allianceRank.setAverageScience(allianceRank.getScience() / allianceRank.getNumberOfEmpires()); allianceRank.setAverageTotal(allianceRank.getTotal() / allianceRank.getNumberOfEmpires()); allianceRank = (AllianceRank) allianceRankManager.save(allianceRank); } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_allianceMemberships + " at column " + colNum); } } logger.debug("alliances created: " + alliances.size()); }
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen der Diplomatie zwischen Allianz und Allianz * // w ww.ja va 2 s. c om * @param workbook - das Workbook * @param key_sheet_diplomacy_aa - der Key fr das Sheet */ public static void parseDiplomacy_AA(HSSFWorkbook workbook, String key_sheet_diplomacy_aa) { HSSFSheet sheet_diplomacy_aa = workbook.getSheet(key_sheet_diplomacy_aa); HSSFRow row; String contact1, contact2, name1, name2; int colNum; AllianceAllianceContact allianceAllianceContact; // sheet_diplomacy_aa -> Abkommen erstellen int rowNum = 1; int count = 0; while ((row = sheet_diplomacy_aa.getRow(rowNum++)) != null) { try { colNum = rowNum; contact1 = row.getCell(0).getStringCellValue(); if (contact1 == null || contact1.isEmpty()) break; while ((contact2 = sheet_diplomacy_aa.getRow(0).getCell(colNum++).getStringCellValue()) != null) { if (contact2 == null || contact2.isEmpty()) break; name1 = row.getCell(colNum - 1).getStringCellValue(); name2 = sheet_diplomacy_aa.getRow(colNum - 1).getCell(rowNum - 1).getStringCellValue(); if (contactAuthorities.get(name1) == null && contactAuthorities.get(name2) == null) continue; if (contactAuthorities.get(name1) == null || contactAuthorities.get(name2) == null) throw new Exception("both authorities must be set: " + contact1 + "(" + name1 + ") <-> " + contact2 + "(" + name2 + ")"); allianceAllianceContact = (AllianceAllianceContact) RandomModels.createContact( getOrCreateAlliance(contact1), getOrCreateAlliance(contact2), contactAuthorities.get(name1), contactAuthorities.get(name2)); for (ContactGroup contactGroup : contactGroupManager .getByAlliance(allianceAllianceContact.getContact1().getId())) { if (contactGroup.getName().equals(name1)) { allianceAllianceContact.getContactGroups().add(contactGroup); } } for (ContactGroup contactGroup : contactGroupManager .getByAlliance(allianceAllianceContact.getContact2().getId())) { if (contactGroup.getName().equals(name2)) { allianceAllianceContact.getContactGroups().add(contactGroup); } } allianceAllianceContact = allianceAllianceContactManager.save(allianceAllianceContact); count++; } } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_diplomacy_aa + ": " + e.getMessage()); } } logger.debug("contacts (alliance-alliance) created: " + count); }
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen der Diplomatie zwischen Allianz und Imperium * //from w w w .j a va2 s.c o m * @param workbook - das Workbook * @param key_sheet_diplomacy_ae - der Key fr das Sheet */ public static void parseDiplomacy_AE(HSSFWorkbook workbook, String key_sheet_diplomacy_ae) { HSSFSheet sheet_diplomacy_ae = workbook.getSheet(key_sheet_diplomacy_ae); HSSFRow row; String contact1, contact2, name; int colNum; EmpireAllianceContact empireAllianceContact; // sheet_diplomacy_ae -> Abkommen erstellen int rowNum = 1; int count = 0; while ((row = sheet_diplomacy_ae.getRow(rowNum++)) != null) { try { colNum = 1; contact1 = row.getCell(0).getStringCellValue(); if (contact1 == null || contact1.isEmpty()) break; while ((contact2 = sheet_diplomacy_ae.getRow(0).getCell(colNum++).getStringCellValue()) != null) { if (contact2 == null || contact2.isEmpty()) break; name = row.getCell(colNum - 1).getStringCellValue(); if (contactAuthorities.get(name) == null) continue; empireAllianceContact = (EmpireAllianceContact) RandomModels.createContact( getOrCreateEmpire(contact1, null), getOrCreateAlliance(contact2), contactAuthorities.get(name), contactAuthorities.get(name)); for (ContactGroup contactGroup : contactGroupManager .getByEmpire(empireAllianceContact.getContact1().getId())) { if (contactGroup.getName().equals(name)) { empireAllianceContact.getContactGroups().add(contactGroup); } } for (ContactGroup contactGroup : contactGroupManager .getByAlliance(empireAllianceContact.getContact2().getId())) { if (contactGroup.getName().equals(name)) { empireAllianceContact.getContactGroups().add(contactGroup); } } empireAllianceContact = empireAllianceContactManager.save(empireAllianceContact); count++; } } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_diplomacy_ae + ": " + e.getMessage()); } } logger.debug("contacts (empire-alliance) created: " + count); }
From source file:com.syncnapsis.utils.data.UniverseEvolutionExcelParser.java
License:Open Source License
/** * Erstellen der Diplomatie zwischen Imperium und Imperium * // w w w . j av a 2 s. com * @param workbook - das Workbook * @param key_sheet_diplomacy_ee - der Key fr das Sheet */ public static void parseDiplomacy_EE(HSSFWorkbook workbook, String key_sheet_diplomacy_ee) { HSSFSheet sheet_diplomacy_ee = workbook.getSheet(key_sheet_diplomacy_ee); HSSFRow row; String contact1, contact2, name1, name2; int colNum; EmpireEmpireContact empireEmpireContact; // sheet_diplomacy_ee -> Abkommen erstellen int rowNum = 1; int count = 0; while ((row = sheet_diplomacy_ee.getRow(rowNum++)) != null) { try { colNum = rowNum; contact1 = row.getCell(0).getStringCellValue(); if (contact1 == null || contact1.isEmpty()) break; while ((contact2 = sheet_diplomacy_ee.getRow(0).getCell(colNum++).getStringCellValue()) != null) { if (contact2 == null || contact2.isEmpty()) break; name1 = row.getCell(colNum - 1).getStringCellValue(); name2 = sheet_diplomacy_ee.getRow(colNum - 1).getCell(rowNum - 1).getStringCellValue(); if (contactAuthorities.get(name1) == null && contactAuthorities.get(name2) == null) continue; if (contactAuthorities.get(name1) == null || contactAuthorities.get(name2) == null) throw new Exception("both authorities must be set: " + contact1 + "(" + name1 + ") <-> " + contact2 + "(" + name2 + ")"); empireEmpireContact = (EmpireEmpireContact) RandomModels.createContact( getOrCreateEmpire(contact1, null), getOrCreateEmpire(contact2, null), contactAuthorities.get(name1), contactAuthorities.get(name2)); for (ContactGroup contactGroup : contactGroupManager .getByEmpire(empireEmpireContact.getContact1().getId())) { if (contactGroup.getName().equals(name1)) { empireEmpireContact.getContactGroups().add(contactGroup); } } for (ContactGroup contactGroup : contactGroupManager .getByEmpire(empireEmpireContact.getContact1().getId())) { if (contactGroup.getName().equals(name2)) { empireEmpireContact.getContactGroups().add(contactGroup); } } empireEmpireContact = empireEmpireContactManager.save(empireEmpireContact); count++; } } catch (Exception e) { e.printStackTrace(); logger.error("error: " + key_sheet_diplomacy_ee + ": " + e.getMessage()); } } logger.debug("contacts (empire-empire) created: " + count); }
From source file:com.synct.report.bm10101_1.java
public void printPageBody(int k, String[] data1, int rowno) throws IOException { try {/*from w ww .ja va 2 s . c o m*/ //[J CellReference cellReference = new CellReference("J13"); HSSFRow row = sheet.getRow(0); HSSFCell cell1 = row.getCell((short) (20)); setBig5CellValue(data1[0], cell1); //U1 LICENSE_DESC row = sheet.getRow(1); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[1], cell1); //G2 P01_NAME row = sheet.getRow(2); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[2], cell1); //G3 ADDR row = sheet.getRow(3); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[3], cell1); //G4 P02_NAME row = sheet.getRow(3); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[4], cell1); //X4 OFFICE_NAME row = sheet.getRow(4); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[5], cell1); //G5 LANNO row = sheet.getRow(5); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[6], cell1); //G6 ADDR row = sheet.getRow(6); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[7], cell1); //G7 USE_CATEGORY_CODE_DESC row = sheet.getRow(7); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[8], cell1); //J8 AREA_ARC row = sheet.getRow(7); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[9], cell1); //X8 AREA_OTHER row = sheet.getRow(8); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[10], cell1); //J9 AREA_SHRINK row = sheet.getRow(8); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[11], cell1); //X9 AREA_TOTAL //***************************************************************************** /* 0 1 2 3 4 5 6 7 8 910111213141516171819202122232425 6 7 8 930 1 2 3 4 5 A B C D E F G H I J K L M N O P Q R S T U V W X Y ZAAABACADAEAFAGAHAIAJ */ row = sheet.getRow(9); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[12], cell1); //G10 USAGE_CODE_DESC row = sheet.getRow(10); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[13], cell1); //G11 BUILDING_CATEGORY row = sheet.getRow(10); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[14], cell1); //X11 CHWANG DONG row = sheet.getRow(10); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[15], cell1); //AF11 BUILD_HIHIGHT row = sheet.getRow(11); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[15], cell1); //G12 BUILDING_KIND_DESC row = sheet.getRow(11); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[16], cell1); //X12 BUILDING_HEIGHT row = sheet.getRow(11); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[17], cell1); //AF12 BUILD_HIHIGHT row = sheet.getRow(12); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[19], cell1); //X13 LAW_COVER_RATE row = sheet.getRow(12); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[18], cell1); //AF13 SPACE_RATE row = sheet.getRow(12); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[20], cell1); //G13 BASE_AREA_TOTAL // row = sheet.getRow(12); // cell1 =row.getCell((short)(23)); // setBig5CellValue(data1[20],cell1); //X13 BUILD_COVER_RATE row = sheet.getRow(13); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[21], cell1); //J14 TOTAL_CONSTRU_AREA row = sheet.getRow(14); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[22], cell1); //J15 STATUTORY_OPEN_SPACE row = sheet.getRow(13); cell1 = row.getCell((short) (26)); setBig5CellValue(data1[23], cell1); //AA14 AIRRAID_U_AREA row = sheet.getRow(14); cell1 = row.getCell((short) (26)); setBig5CellValue(data1[24], cell1); //AA15 AIRRAID_D_AREA row = sheet.getRow(16); cell1 = row.getCell((short) (2)); setBig5CellValue(data1[25], cell1); //C17 PARK_SUM1 row = sheet.getRow(16); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[26], cell1); //J17 PARK_SUM3 row = sheet.getRow(16); cell1 = row.getCell((short) (16)); setBig5CellValue(data1[27], cell1); //Q17 PARK_SUM2 row = sheet.getRow(16); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[28], cell1); //X17 PARK_SUM row = sheet.getRow(16); cell1 = row.getCell((short) (29)); setBig5CellValue(data1[29], cell1); //AD17 PARK_ row = sheet.getRow(17); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[30], cell1); //G18 OTHERS_NAME row = sheet.getRow(18); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[31], cell1); //G19 PRICE row = sheet.getRow(19); cell1 = row.getCell((short) (24)); setBig5CellValue(data1[32], cell1); //Y20 VALID_MONTH row = sheet.getRow(20); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[33], cell1); //G21 APPROVE_LICE_DATE row = sheet.getRow(20); cell1 = row.getCell((short) (24)); setBig5CellValue(data1[34], cell1); //Y21 RECEIVE_LICE_DATE row = sheet.getRow(36); cell1 = row.getCell((short) (1)); setBig5CellValue("W " + data1[1], cell1); //B37 P01_NAME row = sheet.getRow(40); cell1 = row.getCell((short) (15)); setBig5CellValue(data1[35], cell1); //P41 IDENTIFY_LICE_DATE row = sheet.getRow(21); cell1 = row.getCell((short) (0)); setBig5CellValue(data1[36], cell1); //A22 PUBLIC_CODE row = sheet.getRow(21); cell1 = row.getCell((short) (19)); setBig5CellValue(data1[37], cell1); //T22 BASE_AREA_PURPOSE } catch (Exception e) { System.err.println("bm10101_1:printPageBody error is " + e); } }
From source file:com.synct.report.bm10101_1.java
public void printPageBody1(int k, String[] data1, int rowno) throws IOException { try {/* ww w . j av a 2s . com*/ HSSFRow row = sheet1.getRow(1); HSSFCell cell1 = row.getCell((short) (0)); setBig5CellValue("_yHlhG", cell1); //A2 row = sheet1.getRow(0); cell1 = row.getCell((short) (21)); setBig5CellValue(data1[0], cell1); //V1 // System.out.println("bm10101_1:data_other.length " + data_other.length); // System.out.println("bm10101_1:data_other[0] " + data_other[0]); // System.out.println("bm10101_1:data_other[1] " + data_other[1]); int j = 0; for (int i = 1; i <= data_other.length; i++) { //A3 A4 A5 A6 A7 row = sheet1.getRow(1 + i); cell1 = row.getCell((short) (0)); setBig5CellValue(data_other[i], cell1); j = i; System.out.println("bm10101_1:data_other[i] " + data_other[i]); if (StringUtils.isEmpty(data_other[i])) break; } row = sheet1.getRow(3 + j); cell1 = row.getCell((short) (0)); setBig5CellValue("HU", cell1); // } catch (Exception e) { System.err.println("bm10101_1:printPageBody error is " + e); } }
From source file:com.synct.report.bm10101_1.java
public void printPageBody2(int k, String[] data1, int rowno) throws IOException { try {// w w w . java 2s . c o m //[J HSSFRow row = sheet2.getRow(0); HSSFCell cell1 = row.getCell((short) (20)); setBig5CellValue(data1[0], cell1); //U1 LICENSE_DESC row = sheet2.getRow(1); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[1], cell1); //G2 P01_NAME row = sheet2.getRow(2); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[2], cell1); //G3 ADDR row = sheet2.getRow(3); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[3], cell1); //G4 P02_NAME row = sheet2.getRow(3); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[4], cell1); //X4 OFFICE_NAME row = sheet2.getRow(4); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[5], cell1); //G5 LANNO row = sheet2.getRow(5); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[6], cell1); //G6 ADDR row = sheet2.getRow(6); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[7], cell1); //G7 USE_CATEGORY_CODE_DESC row = sheet2.getRow(7); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[8], cell1); //J8 AREA_ARC row = sheet2.getRow(7); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[9], cell1); //X8 AREA_OTHER row = sheet2.getRow(8); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[10], cell1); //J9 AREA_SHRINK row = sheet2.getRow(8); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[11], cell1); //X9 AREA_TOTAL //***************************************************************************** /* 0 1 2 3 4 5 6 7 8 910111213141516171819202122232425 6 7 8 930 1 2 3 4 5 A B C D E F G H I J K L M N O P Q R S T U V W X Y ZAAABACADAEAFAGAHAIAJ */ row = sheet2.getRow(9); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[12], cell1); //G10 USAGE_CODE_DESC row = sheet2.getRow(10); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[13], cell1); //G11 BUILDING_CATEGORY row = sheet2.getRow(10); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[14], cell1); //X11 CHWANG DONG row = sheet2.getRow(10); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[15], cell1); //AF11 BUILD_HIHIGHT row = sheet2.getRow(11); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[15], cell1); //G12 BUILDING_KIND_DESC row = sheet2.getRow(11); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[16], cell1); //X12 BUILDING_HEIGHT row = sheet2.getRow(11); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[17], cell1); //AF12 BUILD_HIHIGHT row = sheet2.getRow(12); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[19], cell1); //X13 LAW_COVER_RATE row = sheet2.getRow(12); cell1 = row.getCell((short) (31)); setBig5CellValue(data1[18], cell1); //AF13 SPACE_RATE row = sheet2.getRow(12); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[20], cell1); //G13 BASE_AREA_TOTAL // row = sheet2.getRow(12); // cell1 =row.getCell((short)(23)); // setBig5CellValue(data1[20],cell1); //X13 BUILD_COVER_RATE row = sheet2.getRow(13); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[21], cell1); //J14 TOTAL_CONSTRU_AREA row = sheet2.getRow(14); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[22], cell1); //J15 STATUTORY_OPEN_SPACE row = sheet2.getRow(13); cell1 = row.getCell((short) (26)); setBig5CellValue(data1[23], cell1); //AA14 AIRRAID_U_AREA row = sheet2.getRow(14); cell1 = row.getCell((short) (26)); setBig5CellValue(data1[24], cell1); //AA15 AIRRAID_D_AREA row = sheet2.getRow(16); cell1 = row.getCell((short) (2)); setBig5CellValue(data1[25], cell1); //C17 PARK_SUM1 row = sheet2.getRow(16); cell1 = row.getCell((short) (9)); setBig5CellValue(data1[26], cell1); //J17 PARK_SUM3 row = sheet2.getRow(16); cell1 = row.getCell((short) (16)); setBig5CellValue(data1[27], cell1); //Q17 PARK_SUM2 row = sheet2.getRow(16); cell1 = row.getCell((short) (23)); setBig5CellValue(data1[28], cell1); //X17 PARK_SUM row = sheet2.getRow(16); cell1 = row.getCell((short) (29)); setBig5CellValue(data1[29], cell1); //AD17 PARK_ row = sheet2.getRow(17); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[30], cell1); //G18 OTHERS_NAME row = sheet2.getRow(18); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[31], cell1); //G19 PRICE row = sheet2.getRow(19); cell1 = row.getCell((short) (24)); setBig5CellValue(data1[32], cell1); //Y20 VALID_MONTH row = sheet2.getRow(20); cell1 = row.getCell((short) (6)); setBig5CellValue(data1[33], cell1); //G21 APPROVE_LICE_DATE row = sheet2.getRow(20); cell1 = row.getCell((short) (24)); setBig5CellValue(data1[34], cell1); //Y21 RECEIVE_LICE_DATE row = sheet2.getRow(36); cell1 = row.getCell((short) (1)); setBig5CellValue("W " + data1[1], cell1); //B37 P01_NAME row = sheet2.getRow(40); cell1 = row.getCell((short) (15)); setBig5CellValue(data1[35], cell1); //P41 IDENTIFY_LICE_DATE row = sheet2.getRow(21); cell1 = row.getCell((short) (0)); setBig5CellValue(data1[36], cell1); //A22 PUBLIC_CODE row = sheet2.getRow(21); cell1 = row.getCell((short) (19)); setBig5CellValue(data1[37], cell1); //T22 BASE_AREA_PURPOSE } catch (Exception e) { System.err.println("bm10101_1 sheet2:printPageBody error is " + e); } }
From source file:com.synct.report.bm10101_1.java
public void printPageBody3(int k, String[] data1, int rowno) throws IOException { try {// w w w . jav a2 s . c om HSSFRow row = sheet3.getRow(1); HSSFCell cell1 = row.getCell((short) (0)); setBig5CellValue("_yHlhG", cell1); //A2 row = sheet3.getRow(0); cell1 = row.getCell((short) (21)); setBig5CellValue(data1[0], cell1); //V1 // System.out.println("bm10101_1:data_other.length " + data_other.length); // System.out.println("bm10101_1:data_other[0] " + data_other[0]); // System.out.println("bm10101_1:data_other[1] " + data_other[1]); int j = 0; for (int i = 1; i <= data_other.length; i++) { //A3 A4 A5 A6 A7 row = sheet3.getRow(1 + i); cell1 = row.getCell((short) (0)); setBig5CellValue(data_other[i], cell1); j = i; System.out.println("bm10101_1:data_other[i] " + data_other[i]); if (StringUtils.isEmpty(data_other[i])) break; } row = sheet3.getRow(3 + j); cell1 = row.getCell((short) (0)); setBig5CellValue("HU", cell1); // } catch (Exception e) { System.err.println("bm10101_1:printPageBody error is " + e); } }