0
votes

Ok, so here's the deal. I'm trying to make a report in the following manner:

  • A main query that will fill the most of my report with some details from mysql database.
  • A sub dataset, with it's own query, that will fill the table in report with some items from other db table.

The main query works fine, and the report gets the right data. But, the sub-dataset that should fill the table actually fills it with all NULL values. When I execute the same query in mysql I get right results, but in iReport all I get is NULL values (for each column).

I used the following procedure:

  • Main query contains input parameter, named etc. Main_ID;
  • I design a main query that uses input parameter in the where clause.
  • THE MAIN QUERY WORKS FINE, AND THE REPORT GETS GOOD RESULTS.
  • Then, I add table to my report. While in wizard, I create a new dataset specifically for the given table. In dataset, I design query by using input parameter, named etc. Sub_ID;
  • After finishing with the wizard, I do right click on table, and choose Edit table datasource. On the top of the dialog I choose the dataset I just created.
  • Then I go to Parameters tab, and click Add. From the dropdown I choose Sub_ID, and for Value expression I set $P{Main_ID}, cause I will use the same input parameter for the where clause in my sub dataset.

After clicking OK, and trying to preview the report, as I stated at the beginning, I get all NULL values in the table. I tried to find solution, but none of the online references helped so far.

If anyone has an idea, I would appreciate it.

Cheers!

1
You should post the snippet of jrxml file (with both quires and datasets definitions)Alex K

1 Answers

0
votes

Hi Sokolovic,

       Can you please check the report connection you are using to connect your main report with your Table data set ?

I too faced a sort of the same issue, and changing the report connection worked for me.