ftkjba Posted August 16, 2017 Share Posted August 16, 2017 Hello all,I want to create a report with a subreport with XML Data Source in Jaspersoft Studio. I was trying to copy example from the chapter XML Data Source and Subreports, but I have empty subreport area.Could you explain me my mistake?The listing of the files is shown below:xml_addressbook.jrxml <?xml version="1.0" encoding="UTF-8"?> [/code]xml_addresses.jrxml<?xml version="1.0" encoding="UTF-8"?> [/code]complex_addressbook.xml Davolio Nancy davolio1@sf.net davolio2@sf.net Music Sport Fuller Andrew af@test.net afullera@fuller.org Cinema Sport Leverling leverling@xyz.it Peacock Margaret margaret@foo.org Food Books [/code] Link to comment Share on other sites More sharing options...
essaghir.bouchra Posted August 16, 2017 Share Posted August 16, 2017 Hello,Try adding isRemoveLineWhenBlank="true" in the report element of the subreport like this: <reportElement isRemoveLineWhenBlank="true" x="0" y="30" width="555" height="40" uuid="746e05bc-ff80-45b1-9093-762398715789">Hope it helps. Link to comment Share on other sites More sharing options...
ftkjba Posted August 16, 2017 Author Share Posted August 16, 2017 Thank you for the answer.I have added isRemoveLineWhenBlank attribute into xml_addressbook.jrxml --> detail --> subreport --> reportElement and after that I got the folowing result:I think the report does not pass the data into the subreport that is why subreport has nothing to display. Link to comment Share on other sites More sharing options...
sanbez Posted August 18, 2017 Share Posted August 18, 2017 1. Change structure node email xml like node hobbies2. Use query // (not /) for subreport, for instance ((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).subDataSource("//hobbies") Link to comment Share on other sites More sharing options...
ftkjba Posted August 20, 2017 Author Share Posted August 20, 2017 Thank sanbez for the answer.I have done what you wrote at office place, and got the right number of rows, but the hobby field is empty in each row. I created "JasperReports project" in Eclipse with the Jaspersoft Studio 6.4.0 plugin at home. I added files described in the question and I had got the worked fine example. When my holiday will be finished I'm going to understand the difference between home and office environment. Thanks for the help. Link to comment Share on other sites More sharing options...
avinashm294 Posted November 28, 2018 Share Posted November 28, 2018 Even I'm getting the same Blnak Screen when i tried to add the subreport. i have added the isRemoveLineWhenBlank="true" to my subreport element still it's not displaying the sub report. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now