Hi I am using Aspose Cells for Java. The problem description is below:
I am using a template for Excel Creation. There is a cell having a Image and Text below it. I am using setVerticalAlignment method to style the text to bottom but it is not working.
Can anybody help ??
Hi Amzad. I have attached the excel file as template. In this file the cell A5 contains a image and text. I want to move the text somewhat down by giving some absolute position from the top. I tried to align the text also but that is not working.
I have written only the relevant code for this purpose.
Code :
Workbook book = new Workbook(templatePath);
Worksheet sheet = book.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.getCell(4,0).getStyle().setVerticalAlignment(TextAlignmentType.BOTTOM);
Thanks Amjad. It worked.
I also have one more requirement like can we absolute position of text inside a cell. Like giving the height of text from top of the cell. I searched on net but could not find anything. Is there any API of Aspose Cells Java available for this purpose.
Hi,
Good to know that the suggested code works for your needs.
Regarding specifying absolute position of text inside a cell (like giving the height of text from top of the cell) I am not sure if there is any options/feature available in MS Excel either (you may specify the position of the shapes though by try using Shape.UpperDeltaY/X attribute(s) in some proportional to row height and column width, etc.). Also, you may set indentation (indent level) while formatting cell contents but there may not be any option to set the absolute position of the inserted text from top of the cell. If you know any such feature in MS Excel, let us know with details with steps involved, we will check it soon.
Thank you.