Report View Differing From TXT Exports (1 Viewer)

dbabaracus

New member
Local time
Today, 07:32
Joined
Jul 26, 2017
Messages
4
I was messing around with getting record counts to show up in a Report Header, and found what appeared to be a workaround.

You do the trick of creating an invisible "=1" box in your group (let's call it "GroupBox") and a running sum box in the footer named BoxSUM. Then I found that if you refer to the footer box in a Report Header text box, the value will actually show up. Something like this:

REPORT HEADER:
Name: [HeaderBox]
Output: Report Count - 52
Expression: ="Report Count - "&[BoxSUM]

GROUP HEADER
Name: [GroupBox]
Output: 1
Expression: =1

REPORT FOOTER:
Name: [BoxSUM]
Output: 52
Expression: =[GroupBox]


However, this only works in Report View. When you go to export the report as a text file, the number in the header reverts back to being a 1 (the usual output when you putting a running sum in the header).

Why is that, and is there a way to export what you actually see in the Report View?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:32
Joined
Feb 19, 2002
Messages
42,981
Think about the inefficiency of putting a record count in a header. Do you think the number is created by magic? No, the entire report needs to be generated to obtain the number. Then the recordset needs to be read again from the beginning in order to print the report.

The best method is to put the counts in the footer where they are logically available because all the records have been read.

Of course, you could use a DCount() to count the records in the query if you insist on putting the count in the header.
 

dbabaracus

New member
Local time
Today, 07:32
Joined
Jul 26, 2017
Messages
4
I agree wholeheartedly. I'm trying to generate a file that meets government criteria - a file that was clearly designed by people who don't work in IT, quite possibly at a time when floppy disks were actually floppy. You know it's wrong, I know it's wrong, but I have to do it nonetheless.
 

Users who are viewing this thread

Top Bottom