Home
Analytics
Dynamic Excel Row Height
SmokesMom
I have a grid in which I have a text field that lists the filters that were sent into the report.
They are configured to be a list like the following and are coded using a \n for a new line for each filter. There are up to 8 filters and I would only like to expand the height of the row according to the number of filters that are present at the time the report is requested.
Filters:
Country: US
State: GA
Status: Active
What I'd like to do is dynamically set the row height for the cell these filters appear in the excel spreadsheet. Currently, it only displays the top line. How do I get the row to autofit the height in excel. How can I get a handle to that row/cell? And where do I need to do it? onCreate, onPrepare?
Thanks for all your time and help.
Kris
Find more posts tagged with
Comments
Yaytay
Which Excel Emitter are you using?<br />
<br />
Some of the more intelligent ones should handle that for you, try <a class='bbc_url' href='
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/'>SpudSoft</a>(mine)
or <a class='bbc_url' href='
http://www.arctorus.com/'>Arctorus</a>.<br
/>
<br />
Jim
SmokesMom
<blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="110325" data-time="1349813323" data-date="09 October 2012 - 01:08 PM"><p>
Which Excel Emitter are you using?<br />
<br />
Some of the more intelligent ones should handle that for you, try <a class='bbc_url' href='
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/'>SpudSoft</a>(mine)
or <a class='bbc_url' href='
http://www.arctorus.com/'>Arctorus</a>.<br
/>
<br />
Jim<br /></p></blockquote>
<br />
Currently I am just using the default that comes with BIRT open source (2.3.2). However, we are in the process of moving to vs. 3.7 and will be swapping out the excel emitter at that point. Still, we should be able to get a handle on the row height and be able to change it. I just don't know where or how to do that.<br />
<br />
Thanks.
Yaytay
<blockquote class='ipsBlockquote' data-author="'SmokesMom'" data-cid="110327" data-time="1349813744" data-date="09 October 2012 - 01:15 PM"><p>
Currently I am just using the default that comes with BIRT open source (2.3.2). However, we are in the process of moving to vs. 3.7 and will be swapping out the excel emitter at that point. Still, we should be able to get a handle on the row height and be able to change it. I just don't know where or how to do that.<br />
<br />
Thanks.<br /></p></blockquote>
Well, I wouldn't want to say it's the only way, or the best way, but this seems to work.<br />
Playing around with the report design is best done early, but I don't know how late you could get away with doing it.<br />
<br />
The code is simply this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var gridDesignElementHandle = reportContext.getDesignHandle().getElementByID( 7 );
var rowDesignElementHandle = gridDesignElementHandle.getRows().get( 1 );
rowDesignElementHandle.setProperty( "height", "10cm" );
</pre>
<br />
I always find I'm flying blind when working with BIRT scripts, not knowing what the right objects are or what their properties are.<br />
In this case I worked from the docs here: <a class='bbc_url' href='
http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.birt.doc.isv/model/api/org/eclipse/birt/report/model/api/GridHandle.html'>http://help.eclipse.org/indigo/</a><br
/>
And was amazed when it worked first time
<br />
<br />
Jim
SmokesMom
Jim,
Thank you so much for your answer. This works great. Unfortunately, we aren't quite at vs. 3.7 yet (soon).
Right now we are on 2.3.2 and it doesn't have a getRows() method that I can find. I also was unable to find the help.eclipse.org/phoenix documentation like the indogo version your link pointed me to.
Thanks again - I guess I have to go back to the drawing room.