Jump to content

BIRT Developer Center Download


Photo
- - - - -

Iterate dinamyc list in birt


  • Please log in to reply
No replies to this topic

#1 rafex

rafex

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 16 June 2017 - 01:55 PM

Hello, I use Birt I have a service that returns an XML, from birt I create a datasource for the service and I create a dataset to read the data of the XML and to map in my report, until there everything well.

My problem is that I have a dynamic list, meaning that the number of values in the list can vary in each row and their names as well. So I can not iterate the list because I do not know how many data it contains. For example my XML is:

 

<?xml version="1.0" encoding="UTF-8"?>
<datos>
<datosMercanciaDams>
   <result>
    <id>1</id>
    <data>
        <canBul>11</canBul>
        <detalle>
            <otrCar>234234</otrCar>
            <cla>
                <des>APS</des>
                <dec>0</dec>
            </cla>
            <zoo>
                <des>1X</des>
                <dec>0</dec>
            </zoo>
        </detalle>
        <mar>11</mar>
        <canCom>1</canCom>
    </data>
 </result>
</datosMercanciaDams>
<datosMercanciaDams>
    <result>
    <id>2</id>
    <data>
        <canBul>17</canBul>
        <detalle>
            <otrCar>4324</otrCar>
            <matTam>
                <des>ACERO INOXIDABLE</des>
                <dec>0</dec>
            </matTam>
            <cla>
                <des>CARGA FRONTAL</des>
                <dec>20</dec>
            </cla>
            <marComOtro>234234</marComOtro>
            <vel>
                <des>CENTRIFUGADO</des>
                <dec>3</dec>
            </vel>
            <tip>
                <des>INDUSTRIAL</des>
                <dec>43</dec>
            </tip>
        </detalle>
        <mar>1</mar>
        <canCom>1</canCom>
</result>
</datosMercanciaDams>
</datos>
 
If you see tag <detalle> is diferent in number of tag and too in names tag and i need show this data in my report as list o table. Could you help me please