Iam using “aspose 7.7.0”(Java) to create XLS from CSV.
I want to add a comment/Note to a column heading to provide guidance on data that a user should enter.
Kindly refer this page:
Is there any method to do this with aspose while creating xls from csv?
Awaiting for your response
Thanks for your posting and using Aspose.Cells.
You can add comments inside any cell using Aspose.Cells. Please see the following documentation article for your reference.
Let us know if you encounter any other issue, we will look into it and help you asap.
yes it works thank you so much
I use the bellow code to add comments.
TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.CSV);
Workbook newWB = new Workbook(newFile.getAbsolutePath(), opts); //newFile in a csv file object
Worksheet newSheet = newWB.getWorksheets().get(0);
Cells tempCells = newSheet.getCells();
//need to add comment for the cells in the first row.
Row r = tempCells.getRows().get(0); // first row
for(int k=0;k<coldesc.length;k++) //coldesc is a string array contains the comments to be added.
Cell c = r.get(k);
int commentIndex = newSheet.getComments().add(c.getName());
Comment comment = newSheet.getComments().get(commentIndex);
As the result of the above code, the proper comment got added in the desired cells. as i want.
But, when i mouse over to a cell, it just blinks for a few seconds and goes off even the mouse hovered to cell.
When i manualy create a comment for a cell using the excel(open office,microsoft excel, etc). that comment will be shown until i mouse out from that cell.
Is there any thing i did wrong with the code?
Kindly let me know.
I have attached the resultant file
- Operating System version
- Operating System Architecture (32bit/64bit)
- MS Excel version
- JDK type & version (please use the command java -version on console)
I have a problem when viewing the XLSX file in LibreOffice Calc. which is created from a CSV with comments added in the first row. (This is not a problem in openOffice or MicrosoftExcel the comment were shown properly).
I use LibreOffice 3.5 in ubuntu 12. i have attached the sample.xlsx file and the screen shot of the problem.
Kindly check the same, And tell any work arround to overcome this issue.
Thanks in advance.