내 Sqlite를 PDF로 내보내려고합니다. 나는 그것을 할 수 있지만 한 행에 결과를 넣는 대신 결과를 다른 열에 넣습니다. 내가 원한 것은 데이터베이스 결과로 같은 열 (행을 증분)의 행을 채우는 것입니다. 이게 내가 가진거야. 이걸로 나를 도울 수 있니?안드로이드에서 itextpdf를 사용하여 테이블을 올바른 방법으로 저장하는 방법은 무엇입니까?
db = new Database(FirstActivity.this);
Cursor c = bd.getGroupsNamesMachines();
PdfPTable table = new PdfPTable(2);
cell = new PdfPCell(new Phrase("groups"));
cell2 = new PdfPCell(new Phrase("machines"));
if (c.moveToFirst()) {
do {
String groups = c.getString(c.getColumnIndex("groupname"));
cell3 = new PdfPCell(new Phrase(groups));
table.addCell(cell3);
} while (c.moveToNext());
}
cell.setColspan(1);
cell2.setColspan(2);
cell3.setColspan(1);
table.addCell(cell);
table.addCell(cell2);
table.addCell(cell3);
귀하가 원하는 * 결과 *를 설명하십시오. 현재 코드 결과가 이상하게 나타납니다. – mkl