Repeating Headers (1 Viewer)

Ahmed.H.Qasim

New member
Local time
Today, 12:18
Joined
Mar 20, 2020
Messages
14
Hi
If I have a report with two columns, how can I repeat the headers as in Excel as shown in the attached image?
 

Attachments

  • age.png
    age.png
    76.9 KB · Views: 63

CJ_London

Super Moderator
Staff member
Local time
Today, 20:18
Joined
Feb 19, 2013
Messages
16,616
difficult but doable (and potentially not very efficient) using a query. I don't propose to suggest how here since there can be a lot of 'gotcha's' in the data and your example is pretty basic. But in principle you would use the mod operator on the ID field to determine whether the related data appears in the first group of columns, or the second. Also in a database, you cannot have repeating column headings

Suggest use the column feature of reports or perhaps two subreports, modify the criteria in each subreport recordsource to display the records required. First subform where ID<=20, second one where ID>20
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:18
Joined
May 7, 2009
Messages
19,245
the code on the report will only work on Print Preview.
it is also columnar report.
each page will list 40 records.
if you have less than 40, it will be "padded" with dummy records.

note the "repeating" header is not really a Report header, but a Group heading
Set to Repeat.
 

Attachments

  • ColumnReport.accdb
    452 KB · Views: 72

Ahmed.H.Qasim

New member
Local time
Today, 12:18
Joined
Mar 20, 2020
Messages
14
im sorry , but can you help me more...
1-what can i do if i need 72 record in each page.
2- i have 6 columns ("id, name,age,info1,info2,info3")
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:18
Joined
Feb 28, 2001
Messages
27,188
The issue of how you format a report has been at least partly addressed, but having an "info1, info2, info3" grouping shows that you also have non-normalized data involved. If that is strictly for a report and the original data elements are normalized in a child table then it makes some kind of sense, I suppose.

I might suggest, though it is probably a pain in the toches to do it, that you could create an Excel Application Object and create a spreadsheet as your report. You could run a query to determine how many records you have so you can decide how many rows you need before you break at the midpoint to start the next set of six columns in column H. Placing the data in the appropriate rows and columns might be no worse than a loop within a loop, because with Excel you have essentially random access to the cells by row/column identifiers.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:18
Joined
May 7, 2009
Messages
19,245
i can only show 56 on each page.
 

Attachments

  • storage.accdb
    1.1 MB · Views: 72

Users who are viewing this thread

Top Bottom