Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Change column header in report
birt_user22
Hi,<br><br>
I have a BIRT report that I am customizing with a script in the beforeFactory. In this report I want to modify a column header to be the value of a cell in an adjacent column. <br><br>
For example, take this example table.<br><br>
Column1----Column2----Column3<br>
April 4----Indiana----State<br><br>
I want to to make "State" replace Columnn2 heading.<br><br>
Can that be done in beforeFactory?<br><br>
Thanks
Find more posts tagged with
Comments
jfranken
<p>What version of BIRT are you running? It can be done in code in the commercial version of BIRT.</p>
<p> </p>
<p>Regards,</p>
<p>Jeff</p>
birt_user22
<p>Hi Jeff,</p>
<p> </p>
<p>I am using BIRT within KNIME, and they are using BIRT Designer Version 3.7.2.v20120213</p>
<p> </p>
<p>Thanks</p>
<p> </p>
<p>Stu</p>
jfranken
<p>Hi Stu,</p>
<p> </p>
<p>Because your designer does the run and render in one step, you'll need to write code to query the database manually to get the value for the column header. Here is a very good example with the code you need:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/35930-running-a-query-in-the-initalize/?p=133369'>http://developer.actuate.com/community/forum/index.php?/topic/35930-running-a-query-in-the-initalize/?p=133369</a></p>
;
<p> </p>
<p><span>(Check out: (Topic_35930)_OS_BIRT_2.6.2_QueryDataFromAlmostAnywhere.rptdesign)</span></p>
<p> </p>
<p>You should be able to get the value from the database using the code in the example and then set the header to that value via something like:</p>
<p> </p>
<p><span>reportContext</span><span>.</span><span>getDesignHandle</span><span>().</span><span>getElementByID</span><span>([element_ID]</span><span>).</span><span>text </span><span>= [value_from_db];</span></p>
<p> </p>
<p><span>Regards,</span></p>
<p><span>Jeff</span></p>
birt_user22
<p>Hi Jeff,</p>
<p> </p>
<p>Thank you, I will try this and let you know how it goes.</p>