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)
Changing structure of table via events - when can it be done, and why only then?
jdewells25
<p>Greetings one and all.</p><p> </p><p><span style="font-size:10px;">(this is the background part that I somehow feel obligated to tell you, even though if I was reading this I'd skip it too)</span></p><p>I am developing something in BIRT that will allow us to specify a table from our database. Hence, we have parameters for each column such as the order number, the header name, et cetera. So! We pull down all that lovely info, and now we need to add columns to a table, one for each result, and in the order supplied from the database.</p><p> </p><p>So I go into the onFetch method of the dataset and tell it to add a column to a table for each record it gets. Code's looking good. Only nothing actually...<em>happens</em>.</p><p> </p><p><span style="font-size:10px;">(skip to here if wanting to cut to the meat of the matter, this is the part that actually needs an answer)</span></p><p>As it turns out, I cannot actually modify the table's structure at all, unless done via the events on the report document itself (e.g. initialize, [before/after]Factory, [before/after]Render, etc). Additionally, trying to use breakpoints on anything other than those events simply does not break the program, even though I have verified that the code is indeed being run. I need to run a table-structure-modifying script for each row pulled from the database, but am worrying that it cannot be done. What's going on?</p><p> </p><p>I've done what research I can and have tried my best to find some crucial bit of info that I've missed but so far I've found nothing. What's the rhyme and reason here? Is it something to do with the various report phases (e.g. presentation, generation)? A failing on my part to understand the key differences between the events and their relationship to the Run and Render tasks? What am I missing?</p><p> </p><p>Any and all input is very much appreciated.</p><p>- JDE</p>
Find more posts tagged with
Comments
micajblock
<blockquote class="ipsBlockquote" data-author="jdewells25" data-cid="127226" data-time="1397043604"><div><p>I am developing something in BIRT that will allow us to specify a table from our database. Hence, we have parameters for each column such as the order number, the header name, et cetera.</p></div></blockquote><p>Why? What is the business reason? What are you trying to accomplish (not the technical way you solved it)? Why not ue multiple data sets and multiple tables. Then you drop the tables you do not want. Much simpler. Example here:</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/simple-example-of-dropping-a-tablechart-r1636'>http://developer.actuate.com/community/devshare/_/designing-birt-reports/simple-example-of-dropping-a-tablechart-r1636</a></p><p> </p><p></p><div
style="font-size:12px;"><p>[color=rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;]What's going on?[/color]</p><p> </p><p>[color=rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;]See this video for order of events:[/color]</p><p> </p><p>
https://www.youtube.com/watch?v=FQ9VjByPNWM</p></div>
jdewells25
<blockquote class="ipsBlockquote" data-author="mblock" data-cid="127243" data-time="1397069494"><div><p> </p><p>Why? What is the business reason? Why not ue multiple data sets and multiple tables. Then you drop the tables you do not want. Much simpler. What's going on?</p></div></blockquote><p> </p><p>I'm afraid that isn't an option for the data we're reporting from. I'm sure this situation isn't at all unfamiliar to a lot of developers.</p><p> </p><p>The video was somewhat informative, but I'm still looking for answers. The onFetch method runs, but any code to add new columns causes no changes and throws no script errors <strong>despite the fact that the same code runs perfectly well on the report's initialize event</strong>.</p><p> </p><p>S.O.S (Save Our Sanity)!</p>
micajblock
<blockquote class="ipsBlockquote" data-author="jdewells25" data-cid="127252" data-time="1397119404"><div><p>I'm afraid that isn't an option for the data we're reporting from. I'm sure this situation isn't at all unfamiliar to a lot of developers.</p></div></blockquote><p>There are always options. What you describe is a technical solution to a business problem. My question was (and still is) - What is the business problem you are trying to solve?</p><p> </p><p>As far as dynamic content creation from within the report, there are multiple examples on the DevShare. Here are two.</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/1496-dynamic-columns-in-a-report'>http://developer.actuate.com/community/devshare/_/designing-birt-reports/1496-dynamic-columns-in-a-report</a></p><p><a
data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/716-dynamic-content-creation-in-birt-232'>http://developer.actuate.com/community/devshare/_/designing-birt-reports/716-dynamic-content-creation-in-birt-232</a></p><p> </p><p>Your
other choice is to build the whole report in a Java program using the DEAPI. That is what Actuate BIRT does for ad-hoc reporting.</p>