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)
Dynamically creating a data set
palbrecht
<p>Hi there,</p>
<p> </p>
<p>following issue:</p>
<p> </p>
<p>I have two data sources:</p>
<ol><li>StarTeam (Database connection)</li>
<li>XML file</li>
</ol><p>The XML file needs some pre-processing. I'm extracting the needed data by using a scripted data set with my own java library included as a .jar file. It basically parses the XML data using XPath expressions and providing an ArrayList of Module() objects which I include by overriding the fetch() method inside the BIRT report designer. I'm passing the XML file's path into my Java code in fetch() with a BIRT parameter.</p>
<p> </p>
<p>In the end I want to combine the data provided by StarTeam and the XML file into a table. The problem I'm dealing is that the columns in the final table should be dynamically added based on the XML data set.</p>
<p> </p>
<p>1. StarTeam table (which is automatically done by BIRT, so no problems here):</p>
<pre class="_prettyXprint">
+
+
+
| Req. ID | Rev. No. |
+
+
+
| 2 | 7 |
| ... | ... |
+
+
+
</pre>
<p>2. Scripted XML Data set should look like this:</p>
<pre class="_prettyXprint">
+
+
+
+
+
+
| Req. ID | module 1 | module 2 | ... | module n |
+
+
+
+
+
+
| 2 | rev. no. | rev. no. | ... | rev. no. |
| ... | ... | ... | ... | ... |
+
+
+
+
+
+
</pre>
<p>module1 - module n is the ArrayList provided by my Java code integrated in the scripted data set.</p>
<p>The data in the ArrayList looks like this (simplified):</p>
<pre class="_prettyXprint">
public class Module {
private String name;
private List<Requirement> requirements;
}
public class Requirement {
private int id;
private String revision;
private String name;
}
</pre>
<p>
How do I build such a data set with dynamic columns that are provided by my external source (XML file -> java parser -> ArrayList)?</p>
<p> </p>
<p>This is how the final table should look like:</p>
<pre class="_prettyXprint">
+
+
+
+
+
+
| Req. ID | module 1 | module 2 | ... | module n |
+
+
+
+
+
+
| 2 | rev. 7 | none | ... | rev. 5 |
| ... | ... | ... | ... | ... |
+
+
+
+
+
+
</pre>
<p>I'm aiming towards a joint data set, but I'm open for any suggestions on how to do this. I'm really out of ideas and feel like google won't provide anymore answers.</p>
<p> </p>
<p>Any help is really appreciated!</p>
<p> </p>
<p>Regards</p>
Find more posts tagged with
Comments
Clement Wong
<p>Can you please clarify and provide more sample data? I understand that you are joining by Req ID, but how is the final table constructed?</p>
<p> </p>
<p>How large is the data set that will be returned by the XML?</p>
<p> </p>
<p>Can you provide a sample the raw XML? There might be another option.</p>
<p> </p>
<p> </p>
<p>My initial thoughts are that we will most likely need to read and build it all in the beforeFactory.</p>
palbrecht
<p>Thanks for Your reply.</p>
<p> </p>
<p>I've got this one solved by using a Crosstab.</p>
<p>Sorry for my late response.</p>
<p> </p>
<p>Regards</p>