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)
Moving Report Elements
deenerj
I'm fairly new to BIRT, so any help is much appreciated.<br />
<br />
I have created an .rptdesign with several tables and grids within one main grid, each element has a data source attached.<br />
<br />
A new requirement I found out is to be able to let the user based on parameters control the order of these elements in the PDF output they are rendering.<br />
<br />
I found a way to reorder the tables and grid using script in beforeFactory, which worked great.<br />
<br />
gh = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("myGrid");<br />
if(params["gOrder"].value){<br />
var parmcount = params["iOrder"].value.length;<br />
var sourceIndex = params["iSourceIndex"];<br />
var orderIndex = params["iOrder"];<br />
for( i=0; i < parmcount; i++ ){<br />
if(orderIndex.value
!= sourceIndex.value
){<br />
parm2 = new RowOperationParameters(0, -1, sourceIndex.value
);<br />
parm2.setSourceIndex(orderIndex.value
);<br />
gh.shiftRow(parm2); <br />
}<br />
}<br />
}<br />
<br />
However, whatever element I moved, the data source/set (stored procedure) is never being kicked off to fill the element with actual data once it has been moved.<br />
<br />
I have verified this by putting in logging in the script and it never hits the "onFetch" of the data source for an element I moved.<br />
<br />
Any thoughts?<br />
<br />
Thanks.
Find more posts tagged with
Comments
mwilliams
Can you attach a sample design that shows the issue, using the sample database?
deenerj
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="94549" data-time="1327357968" data-date="23 January 2012 - 03:32 PM"><p>
Can you attach a sample design that shows the issue, using the sample database?<br /></p></blockquote>
<br />
I would be happy to do that, however this is one of the first time I am posting, so I'm not sure how/where to access the sample database, if you can provide me a bit of guidance, I will certainly look into it.
mwilliams
Sorry for the delayed response. You can access the sample database within your BIRT install. Simply create a new dataSource and select the Classic Models Inc Sample Database. From there, you can query the sample db tables with a SQL dataSet. Hope this helps.
deenerj
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="94706" data-time="1327696912" data-date="27 January 2012 - 01:41 PM"><p>
Sorry for the delayed response. You can access the sample database within your BIRT install. Simply create a new dataSource and select the Classic Models Inc Sample Database. From there, you can query the sample db tables with a SQL dataSet. Hope this helps.<br /></p></blockquote>
<br />
Yes, that helped. Here is a very simple example of the issue I am encountering. The sample is set to work without any reordering, if you go to "beforeFactory", you will see my code that is attempting the shift commented out. You just need to comment and uncomment to see what works and does not. Basically, if I try to move the Cross Tab between the two tables, no data is returned.<br />
<br />
Any help is greatly appreciated.
deenerj
Missed the attachment, here it is....
mwilliams
It has something to do with the row parameters. In your example, if you change the numbers to 0, 1, and 3, it works both ways. I've got a meeting right now, but I'll do some more testing after. Just thought I'd pass that along.