0

The problem encountered was that my detail band is not shown even when the dataset is not empty.

I have a table inside the detail band, and my jrxml worked initially, but when I switched to another datasource, the detail band is not displayed. My understanding is that the report somehow thinks my datasource is empty, so it is not showing the detail band since I set "When No Data Type" to "All Sections No Detail."

However, I'm pretty sure that the datasource is not empty and contains some data. The reason is that when I move the table from the detail band to the summary band, the table is shown and populated with correct data.

I'm wondering if anyone has encountered the same problem before or know how to solve this type of issue.

Alex K
  • 22,315
  • 19
  • 108
  • 236
  • 1
    Something wrong with your template or with your code... Without code it is impossible to help you – Alex K Jun 02 '16 at 19:47

1 Answers1

1

You have selected All section No Detail. It will skip detail band if your main dataset is empty but prints all the other section.

If your table component is not depend on main dataset then use in summary band.

Fahad Anjum
  • 1,246
  • 1
  • 10
  • 19
  • Hi Fahad, I'm wondering what do you mean by main dataset? the first one I created? Also I'm wondering what I should do if I have two tables, and want to ignore the second one when exporting to pdf. I'm using the "net.sf.jasperreports.export.pdf.exclude.origin.band.1" property now, but if I move both table to the summary band, both tables would be ignored:( Thank you very much for your answer! – Cecilia Siyi Wu Jun 03 '16 at 13:21
  • 1
    Click on name of report. then right click on it. Then open dataset and query. that is your main dataset. Check it contains a query or not. If not then add a dummy query into it select 1 as one and remove property All section No Detail. It will display your data now. – Fahad Anjum Jun 03 '16 at 14:31
  • How do I remove the All Section No Detail property? I think I have to select one of the five options which are "," "No Pages," "Blank Page," "All Sections No Detail," and "No Data Section." The "All Sections No Detail" seems to be the option that displays the most of the details, so I'm not sure which ones to use... Thanks! – Cecilia Siyi Wu Jun 03 '16 at 15:47
  • 2
    Are you using select 1 as one in your main dataset? Then their is no need to add do anything. You can use either null or all sections no detail. – Fahad Anjum Jun 04 '16 at 08:18
  • Ahh I see, thank you very much Fahad! – Cecilia Siyi Wu Jun 06 '16 at 20:05