cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

New report suppress subreports not working

0 Kudos
821

I have new report where the suppress subreport is not working as it used to be. I have 3 subreports all of which have fix suppress on everything except the single details which contain less than a dozen fields. These 3 subreports are link to a XSD datasource which always have 1 record so no detail repeat. The subreport detail section is check to suppress if empty and i also tried using a suppress condition if the count of a field is 0. Plain simple as i said. Each subreport are between 3 and 4 inch high.

Now the main report i have some basic headers and then followed by 3 details each one with one of the subreports.

Each subreports are stretch full width but about 1 line high. They all have suppress blank subreports and each detail section also have suppress blank section. I added a dummy text field with a random text beside each subreport and when i print each subreport 3"-4" high is taken but nothing display. So the suppress worked but the space is still taken.

The thing is i have couple hundreds of report that has the same conditions but this one is the first one i build while on Visual Studio 2019. Is that a new bug just for that version. Note that old report still works with the same condition.

So here some image that may help understand.

This one above shows one of the sub reports. they are all the same. You see all section are simply always suppress but detail is suppress on count = 0. plain simple.

Here is the main report (above), couple basic fix section and you see the 3 sub reports. Notice i put a dummy label A,B,C (circled on the right of the sub reports) just to follow the PDF output, also added label in the report/page footer for marking as well. On the right you see i have suppress blank section and the subreport is suppress blank subreport.

Now that is the output it give me. you see my small label B and C shows up while the sub report has been correctly supressed but it also grew in height as i have set CanGrow = true on the sub report. Why is that behavior happening for all new reports ?

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Found the answer. The whole thing is due to a bug that need to be fixed somehow. To find the error it was a trial and error. The report gets longer as soon as the sub report are in. Using a report viewer and inspecting the rpt there is NO subreport so the suppress works partially. If i take the section i have the subreport in and specially set is as suppress the bug is gone. So the problem is in the subreport itself but i does visually get suppress so the problem is in reality the main report being funny with subreports.

So i went into each subreports, set the detail section to be ALWAYS suppressed and ran the report again. That time the bug is gone so the property to suppress a subreport when empty on the e main report works. Remember the subreport is hooked to a dataset with 1 table, 1 row all the time so it repeat once. What i did next is surprising. I forced the detail section of the subreport to be always suppress AND also added a condition Count([field]) = 0 and suddenly everything works as it should. No more useless space. This is the only report that i need to do that double logic which makes no sense. The only difference between these subreports and ALL the other one i have that works is that these 3 subreports have an image in them.

0 Kudos

No it doesn't work even without the label A, B, C. I added them because i didn't understand why that specific report when on 3 pages while it should only be 1. Anyway suppress condition are supposed to disregard any fields that are not data or formula. Here's an example without the fields and to see beginning or end i set a different back color to each detail section

If i force suppress on the 2 last details and footer and such the report add an extra page even though there is no repeat, no space, not "new page after" set anywhere. even if there is still a good 3 inch space left

DellSC
Active Contributor
0 Kudos

I believe the problem is the extra label objects you've put in the sections. Does it work if you remove those?

-Dell