Hi there,
I have some problems with the regions of an Excel-output. I want the height of the region to fit it's content. Already tried by setting the height of the row before adding it to a region and the other way round. None of my ideas worked so far.
Does anybody know a solution?
Regards,
Maik
Hi Eva,
sorry if my posting was short of information. Here's what I'm doing:
My report's creating a XlsWorkbook and of course a XlsSheet. Within the XlsSheet I'm using the method
addRegion ( int p_nFromColumn, int p_nToColumn, int p_nFromRow, int p_nToRow )
to merge multiple XlsCell to a XlsRegion.
Neither XlsCell nor XlsRegion implements the functionality of manipulating the height, because the height is always referring to a XlsRow. But with the XlsCell WrapText-option set, the height of a XlsRow is increasing with it's XlsCells' content. Exactly this behaviour gets lost if a Xls Cell is part of a XlsRegion. What I want is a XlsRegion to fit it's XlsCells' content.
Don't even know if this is an ARIS issue or if Excel can't handle this properly, but I think anybody may came across a solution to this problem.
So, does this make sense to you?
Regards,
Maik
Hi Torsten,
thanks for your advice, but unfortunatly there is no resizing for merged cells at all.
Anyway, I found a solution that works for me. And because I hate people posting about their solution whithout mentioning how it works, here is what I'm doing:
For every row containing regions I add a cell with the combined width (and style if necessary) of the merged cells somewhere at the end.
In a little helper function I search for the longest value to put out and print it additionally to the above mentioned cell.
The height is now calculated by the height of the additional cell and also fits to the regions content.
Unless you don't want to see your additional cell at the end of every row you should hide it.
Therefor you can either import an .xls or .xlt where the column containing your additional cells is already hidden and use it to create your workbook or you have to add a group for this column by calling
groupColumn ( int fromColumn, int toColumn )
and collapse it with
setColumnGroupCollapsed ( int columnNumber, boolean collapsed )
in your XlsSheet. As far as I know there is no hiding of columns in ARIS without grouping them first. And forget about the hidden-opion of the XlsCellStyle. It is ment to hide formulas in protected sheets.
One last hint: If your region spreads over several rows you shouldn't forget to split your longest cell's content over all included rows!
That's pretty much it. Hope anybody will ever need this :)
Regards,
Maik