Profile picture for user maikoliv

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

by Eva Klein
Badge for 'Community Team' achievement
Posted on Wed, 05/18/2011 - 13:49

Hi Maik,

I'm not really sure what you mean. Can you explain it in more detail or could you post a picture of the preferred output?

Regards

Eva

0
by Maik Scharlau Author
Posted on Wed, 05/18/2011 - 17:22

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

0
by Maik Scharlau Author
Posted on Wed, 05/18/2011 - 17:39

Hi,

looks like it's an excel issue. But anyway, appreciate any help...

0
by Torsten Haase
Posted on Thu, 05/19/2011 - 10:05

Hi Maik,

I don't know your script code, but did you try FIRST setting all cell's text (with wrap-text option) and then afterwards combining them to a region? Maybe in this case the row hight is already calculated correctly?

BR,

Torsten

0
by Maik Scharlau Author
Posted on Thu, 05/19/2011 - 18:34

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

0
by Eva Klein
Badge for 'Community Team' achievement
Posted on Fri, 05/20/2011 - 06:55

Thanks for sharing your solution with us :-).

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock