Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8905549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:25:24+00:00 2026-06-15T02:25:24+00:00

I am facing issues while creating table component in report summary panel using XML

  • 0

I am facing issues while creating table component in report summary panel using XML as data source, the final report shows a mere blank line .

Below is my xml data source named ProjectXML.xml

<testsuites>
    <testsuite name="testsuite1"/>
    <testsuite name="testsuite2"/>
    <testsuite name="testsuite3"/>
</testsuites>

Below is my .jrxml file named report12.jrxml

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report12" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bb749013-793e-4a97-a43a-08d89a11ce20">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <style name="table">
        <box>
            <pen lineWidth="1.0" lineColor="#3300CC"/>
        </box>
    </style>
    <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#3300CC"/>
        </box>
    </style>
    <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#3300CC"/>
        </box>
    </style>
    <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#3300CC"/>
        </box>
        <conditionalStyle>
            <conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
            <style backcolor="#EFF7FF"/>
        </conditionalStyle>
    </style>
    <subDataset name="tableDataSet" uuid="44f57638-9650-43f7-9a45-b12c6144c112">
        <queryString language="xPath">
            <![CDATA[/testsuites/testsuite]]>
        </queryString>
        <field name="name" class="java.lang.String">
            <fieldDescription><![CDATA[@name]]></fieldDescription>
        </field>
    </subDataset>
    <queryString language="xPath">
        <![CDATA[/testsuites/testsuite]]>
    </queryString>
    <field name="name" class="java.lang.String">
        <fieldDescription><![CDATA[@name]]></fieldDescription>
    </field>
    <summary>
        <band height="238" splitType="Stretch">
            <componentElement>
                <reportElement uuid="59f049a5-d77e-480c-a1ee-46987630290d" key="table" style="table" x="0" y="0" width="555" height="238"/>
                <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    <datasetRun subDataset="tableDataSet" uuid="6d3ecced-ba97-49c1-aec9-7f5903748fa5">
                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    </datasetRun>
                    <jr:column uuid="ed4b1e17-dcec-4ed6-9f1f-efb543f240b7" width="90">
                        <jr:columnHeader style="table_CH" height="30">
                            <staticText>
                                <reportElement uuid="e2772a76-f9da-4438-8aa3-78cee739bdaf" x="0" y="0" width="90" height="30"/>
                                <textElement/>
                                <text><![CDATA[name]]></text>
                            </staticText>
                        </jr:columnHeader>
                        <jr:detailCell style="table_TD" height="20">
                            <textField>
                                <reportElement uuid="d496fc00-bab8-4b85-bb8d-c75c1cfc3dc4" x="0" y="0" width="90" height="20"/>
                                <textElement/>
                                <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                </jr:table>
            </componentElement>
        </band>
    </summary>
</jasperReport>

Below is the screen shot of the blank preview of the report12.jrxml

report12 Preview

Advanced thanks for any help on this to get the full table with TestSuite names .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:25:25+00:00Added an answer on June 15, 2026 at 2:25 am

    I’ve found a “hack” and not very nice method, but it is working.

    You can add the main (report’s) dataset and use it in the Table component.

    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport .. whenNoDataType="AllSectionsNoDetail" ..>
        <style name="table">
            <box>
                <pen lineWidth="1.0" lineColor="#000000"/>
            </box>
        </style>
        <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <subDataset name="tbDS">
            <queryString language="xPath">
                <![CDATA[/testsuites/testsuite]]>
            </queryString>
            <field name="name" class="java.lang.String">
                <fieldDescription><![CDATA[@name]]></fieldDescription>
            </field>
        </subDataset>
        <queryString language="xPath">
            <![CDATA[/testsuites/testsuite]]>
        </queryString>
        <field name="name" class="java.lang.String">
            <fieldDescription><![CDATA[@name]]></fieldDescription>
        </field>
        <summary>
            <band height="98" splitType="Stretch">
                <componentElement>
                    <reportElement key="table" style="table" x="76" y="33" width="360" height="50"/>
                    <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                        <datasetRun subDataset="tbDS">
                            <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/testsuites/testsuite")]]></dataSourceExpression>
                        </datasetRun>
                        <jr:column width="90">
                            <jr:columnHeader style="table_CH" height="30">
                                <staticText>
                                    <reportElement x="0" y="0" width="90" height="30"/>
                                    <textElement/>
                                    <text><![CDATA[name]]></text>
                                </staticText>
                            </jr:columnHeader>
                            <jr:detailCell style="table_TD" height="20">
                                <textField>
                                    <reportElement x="0" y="0" width="90" height="20"/>
                                    <textElement/>
                                    <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
                                </textField>
                            </jr:detailCell>
                        </jr:column>
                    </jr:table>
                </componentElement>
            </band>
        </summary>
    </jasperReport>
    

    In this sample I’ve used ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/testsuites/testsuite") expression for setting Table’s datasource.

    The result will be:

    The resulted report via iReport preview


    The another way to get design you want – is to use the Detail band (without using Table component).


    I think the situation you described detects the bug of a JasperReports engine.

    I’ve found similar posts at http://community.jaspersoft.com site: Table component and XML datasource and using table elements with xml datasource

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing performance issues while reading/writing data from/to MS-Excel cells. I am using
I am facing some issues while serializing objects (I am using JBoss Drools, and
I am facing a strange problem while creating a file in java using MYSQL.
I am facing some issues while retrieving data from a doctrine pager object! Let
I am using Eclipse Indigo (3.7) and facing issues while installing plugins onto it.
We have implemented webservice which generates xml response. I am facing issue while invoking
i am using Codeigniter i am facing an issue while setting the values of
I'm working using scriptaculous library. However I'm facing some issues with inclusion of the
I have been facing some serious issues while executing this particular JSP page. CODE
i am facing an issue while using sikuli through java, if there are 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.