Hi guys,
I'm new here so I'm sorry if there were any similar questions, it's just that I couldn't find them.
I'm writing a report that outputs an Excel file. Some of the data in the file is in Hebrew and some is in English.
Normally there is no problem, however now, in one of the cells I need the data to be written right to left.
When the data that is in the attributes is only in Hebrew, there is no problem, I just write it into the cell; however in this case there is also a number at the beginning of the text, therefore it places the number on the left while the rest of the text (in the same row) begins on the right.
I would like the number to be on the right as well. Is there a way of doing that?
Also, I cannot find the GUID/API name of the attribute named Identifier. It should have an API name as it isn't a costumed one but it just isn't there. I found the rest of the attributes I needed in the Attribute Types section under the Administration TAB, but this one is just missing. How can that be?
Thanks for your help!!!
Herman
Hello Herman and welcome to community,
a) If you want to override default excel settings, you have to set the cell format, besides its value. Look up the createCellStyle function. Assuming you have the cell object named xCell, you can do something like this:
var xCellStyle = xCell.getCellStyle(); var xDataFormat = xCellStyle.getDataFormat(); var xFont = xWorkbook.createFont(); var xHeaderStyle = xWorkbook.createCellStyle(xFont, Constants.BORDER_THIN, Constants.BORDER_THIN, Constants.BORDER_THIN, Constants.BORDER_THIN, 0, 0, 0, 0, Constants.ALIGN_RIGHT, Constants.ALIGN_CENTER, 0, Constants.C_GREY_80_PERCENT, Constants.SOLID_FOREGROUND, xDataFormat, false, 0, false, 0, true); xCell.setCellStyle(xHeaderStyle);
You might want to chage some settings though. I use this for my headers.
b) Honestly I have no idea why the Identifier attribute does not show up in the attribute list. It is not your issue, this attribute just appears to be hidden. However, try using Constants.AT_ID as API name.
Thank a lot for your help!
Regarding part a. if I'm not mistaken, you're just aligning the text to the right. Am I right?
When I just do the same thing manually in Excel in doesn't solve the problem. What did solve it, was when I changed the text direction
Is there a way to change that part?
Thank you!
I do not see this option in the documentation, therefore we can suspect that this feature is not supported (at least in the 7.2 version of ARIS).
It seems that the only way to achieve your goal, is to use some java excel api. Unfortunately, I have never use this solution, but I believe that such libraries are easy to use.
Have a nice weekend.
Martin