Hi,
I have a table with 2 rows and 2columns in excel sheet. Using Aspose how do i write data in that table? If the original table has 2 rows and 2 columns, and am going to write 5rows and 2 columns of data using Aspose, I need to apply the same style as well when i am writing the data.Please help.
Please refer the attached excels: test1111.xls (Input excel) , test2222.xls (output excel).
My piece of code:
Workbook wb = new Workbook();
wb.open("D:\\test1111.xlsx");
Worksheet ws = wb.getWorksheets().getSheet(0);
int row = 2;
int col = 2;
String col1[] = {"A1","A2","A3","A4","A5","A6","A7","A8"};
int data[] = {1,2,3,4,5,6,7,8};
Cells cells = ws.getCells();
Cell cell ;
for(int i=0;i<col1.length;i++)
{
cell = cells.getCell(row,col);
cell.setValue(col1[i]);
cell = cells.getCell(row,col+1);
cell.setValue(data[i]);
row++;
}
wb.save("D:\\test2222.xlsx");