Data disappearing from report. (1 Viewer)

George-Bowyer

Registered User.
Local time
Today, 11:30
Joined
Dec 21, 2012
Messages
177
I have a database which stores information about clubs and their staff.

I have a report which I use for printing a directory of each club in alphabetical order and their staff, with different staff types in 3 columns (subreports).

On each club form on the database, I have a button that will open the directory report filtered to that club.

This (as far as I am aware) opens the report correctly for every club, with every staff member listed.

However, if I print the 1-club report or export it to pdf, for a very small number of clubs and seemingly at random, some staff members disappear. They are there in print preview and not in print or pdf.
This is obviously not random, however, because it always affects the same people in the same clubs. The staff are listed in order of appointment date and it's the one at the bottom of the list that disappears. It does not appear to have anything to do with the number of staff. Some clubs have 6 staff printed perfectly, another might have 3 of whom 1 disappears.

This probably affects 4 or 5 clubs out of over 250.I can find no similarities to indicate a pattern.

If I run the whole report (unfiltered) the same members of staff disappear in print preview, export to pdf and printed. They are there in report view, but not there when printed or exported.

As this report goes to form a printed directory for which members pay, it is a real problem.

Many thanks,

George

PS: I know that someone is going to ask if I can post a copy to look at, but with GDPR, I don't see how I can do that...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:30
Joined
Feb 28, 2001
Messages
26,996
If it displays correctly in one mode (Preview) but not in the other mode, then the question is whether there is some VBA code behind the scenes in the report. As it happens, there are two parallel event paths and you only choose one of them (based on the mode in which the report was opened.) If you have an OnPrint option, that only opens in a mode involving printing. The other event only fires in an event involving screen viewing. If you have VBA underneath the report, that is where it would look - for the asymmetry of event firing.
 

George-Bowyer

Registered User.
Local time
Today, 11:30
Joined
Dec 21, 2012
Messages
177
Thanks. :) I think you are on to the problem there.

There is some code in the "on print" event in one of the sub reports that shrinks the font of the email address if it is above a certain number of characters .

Code:
If Len(fldEMail1) >= 29 Then
        fldEMail1.FontSize = 8
ElseIf Len(fldEMail1) >= 26 And Len(fldEMail1) < 29 Then
        fldEMail1.FontSize = 9
Else
        fldEMail1.FontSize = 10
End If

I have checked the two examples of this that I know about at the moment and in both cases, the missing people have email addresses long enough to trip the event (when none of the preceding people in the same column do).

Why this stops that particular person from being printed, when the same code still works elsewhere, even on the same page of the report, I don't know...
 

Minty

AWF VIP
Local time
Today, 11:30
Joined
Jul 26, 2013
Messages
10,354
What happens if you simply (temporarily) comment out that code?

Whilst I can't see why it would be causing a problem either, start at the simple end of the trail.
 

June7

AWF VIP
Local time
Today, 03:30
Joined
Mar 9, 2014
Messages
5,423
Perhaps that code should be in OnFormat event instead. As for providing db, make copy and remove/replace sensitive data.
 

George-Bowyer

Registered User.
Local time
Today, 11:30
Joined
Dec 21, 2012
Messages
177
What happens if you simply (temporarily) comment out that code?

Whilst I can't see why it would be causing a problem either, start at the simple end of the trail.

Yep. That seems to fix the problem of the disappearing people. So we know it's the code/event causing the problem.

Leaves me with the problem of the oversized email addresses (the client wants them not to split onto two lines if possible).
 

George-Bowyer

Registered User.
Local time
Today, 11:30
Joined
Dec 21, 2012
Messages
177
Perhaps that code should be in OnFormat event instead. As for providing db, make copy and remove/replace sensitive data.
I will try the on format event, thanks.

Difficult to replace the data when it's pretty much all contact details, therefore GDPR sensitive.
 

George-Bowyer

Registered User.
Local time
Today, 11:30
Joined
Dec 21, 2012
Messages
177
As far as I can tell, moving the code into the on format event appears to have resolved the problem - although I will have to do some extensive proof-reading to confirm that for certain.

Thanks a million, everyone. :)

You are all awesome as always :)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:30
Joined
Feb 28, 2001
Messages
26,996
Glad we could point you in a good direction. And you are quite welcome.
 

Users who are viewing this thread

Top Bottom