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)
Joint Data Set not displaying data
Chris in Alabama
Hi,
New to BIRT, drinking from a fire hose, and (I think) in the deep end of the pool.
I have two scripted data sets where the tables are populated using EventHandler classes. The problem begins when I create a joint data set using the two scripted data sets. The joint data set displays no data. I am displaying the scripted data sets on the report with no problem.
What have I missed?
Thanks,
Chris
Find more posts tagged with
Comments
mwilliams
Is it just not showing in the preview of the dataSet editor? Or is it not showing if you drag the dataSet into your design and run it? What is your BIRT version?
Chris in Alabama
First, thanks for the help. Second, apologies for the long post but when I tried the CODE style it looked horrible.<br />
<br />
I am using version 3.7.2.<br />
<br />
Due to the architecture in place I am getting Java ArrayList as parameter values.<br />
<br />
I have built several reports requiring separate data sources but this is my first attempt at a joint data source.<br />
<br />
During a preview the datasets are empty so, as I would expect, no data at all shows up but I do get all the header information for the datasets.<br />
BTW, how does one populate the data set during development for priviews when there is no database/webservice available?<br />
<br />
I am running the report as an integration test using JUnit 4.<br />
<br />
When I run the integration test the output file has the data for the two scripted data sets but only the header info for the joint data set.<br />
<br />
I am using eventhandlers only on the tables for the scripted data sets( ThingOne and ThingTwo ).<br />
<br />
I am building my test data as follows:<br />
<br />
(imports and package info scrubbed)<br />
public class ThingOneDevelopmentDataGenerator {<br />
private static final String [][] data = <br />
{<br />
{ "01A", "RA1-01A", "RA1" } , <br />
{ "125", "RA1-125", "RA1" } ,<br />
{ "200", "RA1-200", "RA1" }<br />
}; <br />
<br />
public static List<GroupDetail> getData(){<br />
List <GroupDetail> l = new ArrayList<GroupDetail>();<br />
<br />
for ( int i = 0; i < data.length; i++ ){<br />
GroupDetail rec = new GroupDetail();<br />
rec.setGroupCode(data
[0]);<br />
rec.setGroupName(data
[1]);<br />
rec.setLabCode(data
[2]);<br />
l.add(rec);<br />
}<br />
<br />
return l;<br />
}<br />
}<br />
<br />
public class ThingTwoDevelopmentDataGenerator {<br />
private static final String [][] data = {<br />
{ "01A", "BA848DB376BE4B7AE04400212861D336" },<br />
{ "01A", "BA848DB375E54B7AE04400212861D336" },<br />
{ "01A", "BA848DB375E34B7AE04400212861D336" },<br />
{ "125", "BA848DB37CFF4B7AE04400212861D336" },<br />
{ "125", "BA848DB37BFB4B7AE04400212861D336" },<br />
{ "125", "BA848DB373234B7AE04400212861D336" },<br />
{ "125", "BA848DB3719A4B7AE04400212861D336" },<br />
{ "125", "BA848DB36ADD4B7AE04400212861D336" },<br />
{ "200", "BA848DB37EC64B7AE04400212861D336" },<br />
{ "200", "BA848DB36E934B7AE04400212861D336" },<br />
{ "200", "BA848DB36B584B7AE04400212861D336" },<br />
{ "HAA", "BA848DB36D2D4B7AE04400212861D336" },<br />
{ "HAA", "BA848DB36D2C4B7AE04400212861D336" },<br />
{ "HAA", "BA848DB36CDA4B7AE04400212861D336" },<br />
{ "HAA", "BA848DB36A614B7AE04400212861D336" }<br />
};<br />
public static List <GroupOwnerAssociation> getData(){<br />
List <GroupOwnerAssociation> l = new ArrayList();<br />
for ( int i = 0; i < data.length; i++ ){<br />
GroupOwnerAssociation rec = new GroupOwnerAssociation();<br />
rec.setEquipmentOwnerId(data
[1]);<br />
rec.setGroupCode(data
[0]);<br />
l.add(rec);<br />
}<br />
return l;<br />
}<br />
}<br />
<br />
The test is:<br />
<br />
@Test<
;br />
public void testRunnerUsingDefaultPDFRenderOption() throws Exception {<br />
<br />
GroupReportRunner runner = new GroupReportRunner();<br />
<br />
ReportsDao dao = new GroupReportDaoImpl();<br />
dao.setRenderOption(dao.PDF_RENDER_OPTION);<br />
<br />
List l = GroupDetailDevelopmentDataGenerator.getData();<br />
System.out.println( l.size() );<br />
dao.setParameterValue(GroupReportDaoImpl.GROUP_KEY,<br />
GroupDetailDevelopmentDataGenerator.getData());<br />
<br />
dao.setParameterValue(GroupReportDaoImpl.GROUP_EQUIPMENT_OWNER_ASSOCIATIONS,<br />
GroupOwnerXrefDevelopmentDataGenerator.getData());<br />
<br />
OutputStream os = new BufferedOutputStream(new FileOutputStream(<br />
new File("e:/temp/headerInfo.pdf")));<br />
dao.setOutputStream(os);<br />
<br />
runner.executeReport(dao);<br />
<br />
}<br />
<br />
<br />
<br />
/*<br />
The main infrastructure for running the report engine is contained in AbstractReportRunner. <br />
*/<br />
public class GroupReportRunner extends AbstractReportRunner {<br />
private static final Logger logger = Logger<br />
.getLogger(GroupReportRunner.class);<br />
private static final String REPORT_DESIGN = "header_info.rptdesign";<br />
<br />
public void executeReport(ReportsDao dao) throws EngineException {<br />
executeReport( dao, REPORT_DESIGN );<br />
}<br />
}
mwilliams
Is the report that's not showing the joint dataSet data just a table with the joint dataSet data in it? If so, can you try putting two text boxes in front of that table, in your report and binding one of them to your first dataSet and one to the second? Can you attach your report? Better yet, if you could recreate this in a way that I can run the report, that'd be helpful.
Chris in Alabama
I made some discoveries in the past few hours.
While grasping at straws I decided to delete all tables from the layout, drag the joined dataset to the layout, and run the report. There was data in the table using the joined data set.
I then dragged the scripted data sets to the layout editor and ran the report. The joined dataset still had data but the tables using the scripted data sets did not.
I then reversed the order of the tables and the tables using the scripted data sources showed data and the joined table did not. (The original condition)
The only thing that changed was the order of the tables in the layout.
It appears that once a data source's records are processed the records are no longer available. This behavior is different from my use of datasets populated via jdbc not using eventhandlers.
What should I read to better understand what is going on in the internals?
How do I make the rows available for processing in subsequent event handlers?
I have attached the two output files and the datahandler class.
Once again, thanks for the help.