Jump to content
We've recently updated our Privacy Statement, available here ×

Multiple XML for Same jasper jrxml


vyankateshh

Recommended Posts

So i have two xml file one contains parameters and another contains table data i am able to work with parameter and get that data from xml but i have issue with table data i tries using JRBeanCollectionDataSource and trying to use JRDataSource  what i am basically trying to do is mapping for parameters i dont know about table.

Can anyone help me with steps or anything that can be helpfull.

Thanks for the help.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hello ,

i have two xml file i have to fill my jasper report with the data in the xml . one of the xml file contains parameter data and another contains table data with the help of that i need to feel the jrxml . i have used jrdatasource and jrbeancollectiondatasource but the result is still when i generate pdf . Can you also let me know how can i create innertable and outertable in jrxml

 

Link to comment
Share on other sites

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

Hello There, I've read your requirements but am still not clear on what you are trying to accomplish. Do you mind sharing screenshots of your data sets(Main and sub-datasets and mention if they are related or not) and the desired output? Are you trying to pass parameters from the first data set into to filter the second data set?

Provide the info so we can better guide you.  

Thank you

 

Link to comment
Share on other sites

Basically i have two xml file one xml containing all the parameters data 

File 1

<parameter>
            <key>City</key>
            <value>ST. Paul</value>
        </parameter>
        <parameter>
            <key>Name</key>
            <value>Raj Qureshi </value>
        </parameter>
        <parameter>
            <key>State</key>
            <value>MN</value>
        </parameter>
        <parameter>
            <key>StreetName</key>
            <value>160 Kellogg Blvd E</value>
        </parameter>

File 2

2nd xml contains nested data 

 

<table>
     <tableName>Results</tableName>
            <row>
                <column>
                    <columnName>_ID</columnName>
                    <columnValue>5232</columnValue>
                </column>
                <column>
                    <columnName>Name</columnName>
                    <columnValue>Raj Qureshi</columnValue>
                </column>
                <innerTable>
                     <tableName>ProgramDecisions</tableName>
                    <row>
                        <column>
                            <columnName>_ID</columnName>
                            <columnValue>PT26355</columnValue>
                        </column>
                        <column>
                            <columnName>Age </columnName>
                            <columnValue>12</columnValue>
                        </column>
                    </row>
                </innerTable>
            <row>
            <row>
             Structure same as above
            </row>
    </table>

So I am able to access data from 1st xml(parameters) but not able to get the data from 2nd xml 

I tried using  Xpath  but still data result is null in table after generating pdf .

**requirements- 

1)To get data from xml to populate table using 2nd xml.

2)Basic java code for using both xml at the same time (if possible).

3)Steps or idea to use both dataset(xml ) in jasper studio at the same time 

**Acutal result-

image.png.ce037e90b7a2a1141121fcb005514f20.png

**Expected result-

image.png.724157591727c36675d724207f2f30c3.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...