I am using aspose.cell library in my android application to create excel sheets as an output in sdcard.
Here is my code:
void insertData() throws Exception {
//Get the SD card path
String sdPath = Environment.getExternalStorageDirectory().getPath() + File.separator;
Workbook wb = new Workbook();
Worksheet worksheet = wb.getWorksheets().get(0);
Cells cells = worksheet.getCells();
ArrayList<String> arr = new ArrayList<String>();
arr.add("one");
arr.add("two");
arr.add("three");
int i = 0;
for(String value : arr){
//Put some values into cells
//Log.i("rubanraj", value);
Cell cell = cells.get("A"+String.valueOf(++i)); //for A1,A2,A3...
cell.putValue(value);
}
wb.save(sdPath + "Cells_InsertRowsAndColumns.xlsx",SaveFormat.XLSX);
}
I have a set of data in arrayList, as final i need to insert that values in to a column in my worksheet. For that, i have used one for loop to get the cell position like A1,A2,A3.. from worksheet and inserting data one by one. Everything is fine, but i havent used aspose lib before so i dont know much things. Actually what i required here is, how to insert the arraylist of values directly to a Column like (A,B,C...) in excel sheet using this aspose.cell lib?
Here I ll give some links which i referred for this work.
https://github.com/asposecells/Aspose_Cells_Android
I have already tried apache POI and jxl libraries, but i am feeling aspose is easy to use compared to other libs.