I am creating a table using POI in word the table is created successfully but i want to do a new line between each text in a cell ,I am not able to do that,here is what i have done so far,
XWPFTable candidateTrackerTable = document.createTable();
XWPFTableRow canndidateTrackerTableRowOne = candidateTrackerTable.getRow(0);
canndidateTrackerTableRowOne.getCell(0).setText("Presented ");
canndidateTrackerTableRowOne.addNewTableCell().setText("Interview ");
canndidateTrackerTableRowOne.addNewTableCell().setText("Phone ");
canndidateTrackerTableRowOne.addNewTableCell().setText("Final Interview ");
canndidateTrackerTableRowOne.addNewTableCell().setText("Offer ");
XWPFTableRow canndidateTrackerTableRowTwo = null;
for(Map.Entry<Integer, ArrayList<String>> candidateName:aMap.entrySet()){
canndidateTrackerTableRowTwo = candidateTrackerTable.createRow();
for(String s:candidateName.getValue()){
//System.out.println("------>>"+s);
canndidateTrackerTableRowTwo.getCell(0).setText(String.valueOf(s)+"\n");
}
for(Map.Entry<Integer, ArrayList<String>> candidatePhone:bMap.entrySet()){
for(String s1:candidatePhone.getValue()){
//System.out.println("------>>"+s1);
canndidateTrackerTableRowTwo.getCell(1).setText(String.valueOf(s1));
}
for(Map.Entry<Integer, ArrayList<String>> candidateSkyped: cMap.entrySet())
for(String s2:candidateSkyped.getValue())
canndidateTrackerTableRowTwo.getCell(2).setText(String.valueOf(s2));
for(Map.Entry<Integer, ArrayList<String>> candidateOnsite : dMap.entrySet())
for(String s3:candidateOnsite.getValue())
canndidateTrackerTableRowTwo.getCell(3).setText(String.valueOf(s3));
for(Map.Entry<Integer, ArrayList<String>> candidateOffered : eMap.entrySet())
for(String s4:candidateOffered.getValue())
canndidateTrackerTableRowTwo.getCell(4).setText(String.valueOf(s4));
}
}
i want to add new line between each canndidateTrackerTableRowTwo.getCell(0).setText(String.valueOf(s)+"\n");