這是我的代碼,我想每次動態添加我從EditText
獲得的數據。如何在Android中創建xls表單並向其中添加動態數據?
//New Workbook
Workbook wb = new HSSFWorkbook();
Cell c = null;
//Cell style for header row
CellStyle cs = wb.createCellStyle();
cs.setFillForegroundColor(HSSFColor.LIME.index);
cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//New Sheet
Sheet sheet1 = null;
sheet1 = wb.createSheet("MYtest");
// Generate column headings
Row row1=sheet1.createRow(0);
c = row1.createCell(0);
c.setCellValue("ENTRY ONE");
c.setCellStyle(cs);
c = row1.createCell(1);
c.setCellValue("ENTRY TWO");
c.setCellStyle(cs);
c = row1.createCell(2);
c.setCellValue("ENTRY THREE");
c.setCellStyle(cs);
你應該細分或縮小你的問題。您的問題是創建XLS文件還是構建Android GUI來檢索用戶輸入? –