Help! cant get hello world sub reports to work - always get "Document is empty"

0

I created a new report called slice which is the sub report.  In it I used the following SQL:

select 1 as registrations, 2 as cash

which returns this:

registrations  cash
1 2

I then removed all bands except detail, and dragged the two fields one above the other:

$F(registrations)

$F(cash)

Now when I preview this sub report, I get:

1

2

Great.

Now I create the mail report, and drag the sub report Element into the "Detail 1" section, and select the exisiting sub report "slice".

However, when I preview this master report, I just get "Document is Empty", when it certainly should not be.

what am I doing wrong?

 

 

 

 

john.v.little's picture
Joined: Aug 28 2014 - 3:29am
Last seen: 5 years 4 weeks ago

2 Answers:

1

The main report has a data source, but does not have any of its own queries, it only gets data from sub reports.

The workaround to fix this bug is to create a dummy querey (I use "select 1"), then it works.  Shame you cant have a main report which just has sub-reports.

john.v.little's picture
Joined: Aug 28 2014 - 3:29am
Last seen: 5 years 4 weeks ago
1

Does the master report has a datasource (or data adapter) selected?

Check this tutorial on Sub-Reports http://community.jaspersoft.com/wiki/subreports-jaspersoft-studio

marianol's picture
4738
Joined: Sep 13 2011 - 8:04am
Last seen: 1 year 3 weeks ago
Feedback