<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Hello, I am trying to import data to excel using
aspose.celss for java. I have an arraylist containing class objects. I didn’t
find the Cells.ImportCustomObjects() mehtod in java. Is this something specific
to .NET? If so, how can we import data in java in this scenario. Appreciate
your help on this one. Thanks, Akshay
Hi,
Hello,
I tried using importobjectArray() and twodimensionalArray() methods but having problems. I am not sure how to pass my arrayList containing custom objects to importObjectArray() method. Here is my code for reference..
ReportTO rpTO = new ReportTO();
rpTO.setCustomerID(1);
rpTO.setCustomerName("Akshay");
ArrayList finalList = new ArrayList();
finalList.add(rpTO);
String TEMPLATE_FILE_PATH = "C:\\Exports\\testXLS.xls";
Workbook wb = new Workbook(TEMPLATE_FILE_PATH);
Cells cells = wb.getWorksheets().get(0).getCells();
cells.importObjectArray(finalList.toArray(),0,0,False);
I am not sure if I can use it in the above way..but all it does is print the address of ReportTO in the excel. I want the values in the TO to printed to excel..
Could you please provide some insight in how to use that objectArray/twodimensionalArray methods in this scenario?
Appreciate your help on this !
Thanks,
Akshay
Hi,
Hi;
For this requirement about Cells.ImportCustomObjects(), we have supported this method for java version, please try the new fix: Aspose.Cells for Java v7.1.1.3.
Please see the following code.
Java
ArrayList al = …;
cells.importCustomObjects(al, startRow, startColumn, null);
The issues you have found earlier (filed as CELLSJAVA-40132) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Hi,
I am a new user to Aspose.cells for java. I am not able to get this example working. My excel sheet is coming out empty.
I am sending you attached code. I am using Aspose for cells 8.2.1 version.
Thanks.
I am able to figure out my issue, Please ignore my post.
Hi Amita,