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)
onFetch event for datasets
mastermine11
<p>I am using a dataset in my report, and hooked it up to a table. I've confirmed that the dataset returns 12 rows when I "Preview Results" in the "Edit Data Set" window. </p><p> </p><p>From my understanding, the "onFetch" event for the dataset gets called once for every returned row of the dataset. So, in my example, the "onFetch" event will get called 12 times.</p><p> </p><p>So, I view the report by navigating to Run > View Report > In Web Viewer, the onFetch event does get called 12 times. </p><p> </p><p>But, when I view the report by run > View Report > As Doc, the onFetch event gets called once. Also, When I click on the preview tab in the designer, the onFetch event gets called once. I have tried to view it as HTML as well, and the onFetch event gets called once.</p><p> </p><p>Am I misunderstanding something here? I am using BIRT 4.3</p><p> </p><p>In the onFetch event, do I have to do something special to for the next onFetch events to get called?</p>
Find more posts tagged with
Comments
micajblock
<p>How do you know how many times it get's called?</p>
mastermine11
<p>Two ways.</p><p> </p><p>1. I am showing a JFrame dialog box in the onFetch event.</p><p>2. I have a global array with 12 elements initially set. Everytime, the onFetch event gets called, it will increment array index, and assign the array at the new index a new value.</p><p> </p><p>Even when I disable my JFrame dialog, I can infer from my report results that the event gets called once.</p>
micajblock
<p>Do 12 rows appear in the report? If yes, then it is called 12 times. BTW, what are you trying to accomplish?</p>
mastermine11
<p>12 rows do appear in the report, and they are all initially set a value. [color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;]Everytime, the onFetch event gets called, it will increment the current index, and assign the row at that index a different value. I know that onFetch only gets called once because only the first row is adjusted. Every other row still has the initial value. The report generates fine in the Web Viewer, but not in doc, docx, html, preview, etc...[/color]</p><p> </p><p>My goal is: for every returned row in the dataset, I want to pass the row into a function. </p><p> </p><p>I thought the onFetch event will call 12 times, thus passing the row object into the function each time. </p>
micajblock
<p>Use the onCreate event of the detail row (or table).</p>
mastermine11
<p>Great, onCreate for the table row works exactly as I want. Thanks a lot for the help mblock.</p><p> </p><p>What is the difference between onCreate and onFetch. When would you ever want to use onFetch?</p><p> </p><p> </p>
micajblock
<p>onFetch is for data manipulation mostly.</p>