Report Shrink Bug? (1 Viewer)

ALFrank

New member
Local time
Today, 07:02
Joined
May 2, 2024
Messages
3
I have a report with Parents, Children, and GrandChildren sections. The sections have different colored backgrounds and all have the can shrink function turned on.

They are not in Report view, but In Print preview and in the actual print I get these lines like the section didn't shrink completely. They are not consistent and only show up sometimes. Also clicking on the report to zoom in can take away or move the lines to other areas.

Has anyone experienced this? (See line at top between Frank and George)
1714666668323.png

1714666700640.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:02
Joined
Feb 19, 2002
Messages
43,466
The problem may have to do with the alternate row colors.

Also, the headers should go in the page header NOT in the report header. The Report Header only prints ONCE as the first page of the report.
 

ALFrank

New member
Local time
Today, 07:02
Joined
May 2, 2024
Messages
3
I've tried a few different alternate colors, and No Color, doesn't seem to affect it.

This was just an example I threw together to show the problem, but I think you misread the Page Header as Report Header :p.
 

Simon_C

Registered User.
Local time
Today, 13:02
Joined
Jun 7, 2019
Messages
40
I know it looks like it from the image, but are each of the text boxes that contain the names positioned at the very top of their section i.e. is the 'Top' property set to zero? And is each section the exact same height as the text box that it contains, and no larger?

I ask because the 'Can Shrink' property will only shrink each section by as much as the various controls it contains shrink by. What I mean is, it won't shrink sections down to nothing if there's some space above the top of the top control or below the bottom of the bottom control.

If there's even a tiny gap either above or below the text box is could be causing a 'hairline' version of the section to be generated, something that's only made obvious by the different colouring.
 

ALFrank

New member
Local time
Today, 07:02
Joined
May 2, 2024
Messages
3
All the sizes are adjusted properly. The odd thing is it is recreatable, I've tried this on 3 machines, you can go make a test database with similar setup and it will do it. It only happens on some areas (Like in the image there is a line between Frank and George, but not between John and Luke). Add onto that when you zoom in/out the lines will disappear and/or move to a different location, it's like a display bug or something that actually affects the report printed out.

I'll attach the database if anyone wants to see/mess with it. I'm getting the feeling this is just a Microsoft bug though. (The bug only shows on Print Preview, not Report View)
 

Attachments

  • ShrinkExampleBug.zip
    26.3 KB · Views: 7

Simon_C

Registered User.
Local time
Today, 13:02
Joined
Jun 7, 2019
Messages
40
I do see what you mean. At 100%, in Print Preview, I get the line between John and Luke but not between Frank and George and different zooms mostly get rid of it altogether. Printed to PDF I get both the John / Luke and Frank / George lines.

I've tried a number of tweaks to the report but I can't completely get rid of it.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:02
Joined
Sep 21, 2011
Messages
14,434
I get the line between John & Luke in Preview and then on other pair if sent to PDF?
Only one each time though.
 

Simon_C

Registered User.
Local time
Today, 13:02
Joined
Jun 7, 2019
Messages
40
The one thing I didn't think of earlier was to include some code in the Print events for the two header sections.

Code:
Private Sub GroupHeader1_Print(Cancel As Integer, PrintCount As Integer)
    Cancel = IsNull(Me.ChildFirstName)
End Sub

Private Sub GroupHeader2_Print(Cancel As Integer, PrintCount As Integer)
    Cancel = IsNull(Me.GrandChildFirstName)
End Sub

This does seem to get rid of the lines but obviously this is a much simpler example report than many real-world applications, and it's relatively easy to do this here.

It's interesting that just including the code for the second of those, i.e. for the GrandChild section, results in the thin line remaining, but now appearing in the pale blue of the Child section background.
 

Users who are viewing this thread

Top Bottom