This entry guides you through the steps on how to exclude report section from being rendered if it has no row of data or empty datasource by using RenderIf scripting
Scenario
- Exclude report section 2 from being rendered since it has no row of data. Below was the initial report
RML template design as per below
Section 1
Section 2
- Under Report tab – Sections – Right click Section 2 – Edit Section
- In Section Wizard, click on Scripts tab and input below script inside RenderIf field
var ds = DataCacheManager.getCache(“Fruit Sales 2”);
ds.getRecordCount()!=0
- Click Finish and with above script, Section 2 will not be rendered.