Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int warunek = 0;
- try {
- FileInputStream filename = new FileInputStream("INFO.xls");
- HSSFWorkbook workbook = new HSSFWorkbook(filename);
- HSSFSheet report = workbook.getSheet("REPORTS");
- HSSFRow head = report.createRow(0);
- head.createCell(0).setCellValue("Type");
- head.createCell(1).setCellValue("TransactionID");
- head.createCell(2).setCellValue("OrderID");
- head.createCell(3).setCellValue("ENV");
- head.createCell(4).setCellValue("Customer");
- head.createCell(5).setCellValue("DP");
- head.createCell(6).setCellValue("MSISDN");
- head.createCell(7).setCellValue("IMSI");
- head.createCell(8).setCellValue("Date");
- head.createCell(9).setCellValue("Order Status");
- do{
- HSSFRow repoRow = report.getRow(warunek);
- if(repoRow != null){
- warunek++;
- }else {
- repoRow = report.createRow(warunek);
- repoRow.createCell(0).setCellValue(type);
- repoRow.createCell(1).setCellValue(transaction);
- repoRow.createCell(2).setCellValue(order);
- repoRow.createCell(3).setCellValue(env);
- repoRow.createCell(4).setCellValue(customer);
- repoRow.createCell(5).setCellValue(dp);
- repoRow.createCell(6).setCellValue(msisdn);
- repoRow.createCell(7).setCellValue(imsi);
- repoRow.createCell(8).setCellValue(obecnadata);
- repoRow.createCell(9).setCellValue(status);
- warunek = -1;
- }
- }while (warunek <= -1);
- FileOutputStream fileOut = new FileOutputStream(new File("INFO.xls"));
- workbook.write(fileOut);
- fileOut.close();
- }catch(IOException e){
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement