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)
How to display repeating tag xml in BIRT
clubmed95
<p>Hi All,</p>
<p> </p>
<p>I have an XML datasource, and a tag in this XML which can repeat several times.</p>
<p> </p>
<p>For example, the tag Client is repeated below :</p>
<p> </p>
<p><Clients></p>
<p> <Client><br>
<lastname>TIGER</lastname><br>
<firstname>SCOTT</firstname><br>
</Client><br>
<Client></p>
<p> <lastname>LION</lastname><br>
<firstname>BOB</firstname><br>
</Client><br>
...<br>
</Clients><br>
</p>
<p>How can I display this tag in BIRT in order to retrieve the 2 clients ?</p>
<p> </p>
<p>Thank you by advance</p>
<p> </p>
<p>ML</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>In Row Mapping of the XML Data Set Editor, choose the Client tag in the XML Structure and click the arrow to bring it to the XML Element Selection:</p>
<p>
clubmed95
<p>Hi Pierre,</p>
<p> </p>
<p>Many thanks for your quick answer, I will test it.</p>
<p> </p>
<p>I have another question for you concerning Page Break management with XML Datasource.</p>
<p> </p>
<p>How can we apply a Page Break with repeating tag ?</p>
<p> </p>
<p>For exemple, in the XML example above, I need to apply :</p>
<p> </p>
<p>- a first masterpage for the first client with a break page.</p>
<p>- a second masterpage for the second client with a break page.</p>
<p> </p>
<p>Is it possible to do that ?</p>
<p> </p>
<p>Thank You</p>
<p> </p>
<p>ML</p>
pricher
<p>Hi,</p>
<p> </p>
<p>Page break management doesn't come with the XML data source or the XML data set you create. It comes with the table you create.</p>
<p> </p>
<p>Having said that, I am not totally clear on what you are trying to accomplish. Are you more concerned about page breaks or masterpages? You give a scenario for two users, but I presume you're going to have more than that, right? I think to answer you more correctly, we would need some sort of a mock up of the report you are trying to build.</p>
<p> </p>
<p>Regards,</p>
<p> </p>
<p>P.</p>
clubmed95
<p>Hi,</p>
<p> </p>
<p>I have indeed more than 2 clients to display.</p>
<p> </p>
<p>I have a master page to apply to the first page, and another masterpage for the other pages.</p>
<p> </p>
<p>On my first page, I have a table with all my clients but if have a lot of clients, the display of them could be on 2 or 3 pages.</p>
<p> </p>
<p>How can I do to display the masterpages ?</p>
<p> </p>
<p>Thanks by advance.</p>
<p> </p>
<p>ML</p>
pricher
<p>You cannot change the master page while the table is processing. <span>However, you can use row count filtering to add two tables that are the same and put them on different master pages. For example table1, linked to First Master Page, could list the first 20 customers and table2, linked to Second Master Page, could list the rest.</span></p>
<p> </p>
<p><span>Attached is an example based on Classic Models; it will work the same way with an XML data source.</span> The steps are</p>
<p> </p>
<p>1. Initialize variable rowCnt in the beforeFactory method of the report;</p>
<p>2. Add a computed column called rowNum to the dataset. The column will store the incremented value of rowCnt;</p>
<p>3. Add a 2-row grid and bind the grid to the data set</p>
<p>4. In the first row of the grid, add your table. Do not bind the table to the data set: it will takes its data from the grid. Add a filter to the table to limit the output to the number of rows you want on the first page. Here, I have put 20. In the Page Break property of the table, make the Page Break interval 20 and select First Master Page as the master page.</p>
<p>5. Copy and paste the table into row 2 of the grid. Modify the filter condition to show the remaining rows. In the Page Break property, select Second Master Page as the master page.</p>
<p> </p>
<p>This should do it!</p>
<p> </p>
<p>P.</p>
clubmed95
<p>Hi Pierre,</p>
<p> </p>
<p>many thanks for your answer.</p>
<p> </p>
<p>It is very kind.</p>
<p> </p>
<p>Regards,</p>
<p> </p>
<p>ML</p>