Hi All,
I know page numbers must be always in a report's page footer or page header section, but I need those numbers in a middle of page, and on every page. Is that possible? Thanks in advance
18 2157
I dont really think so, since the control has to be some area (Header/footer, or detail, yes I do believe the page control can be in the detail section as well, but I haven't tried).
Problem with putting it in the detail section is that it would be visible within every detail, and that also does not place the pagenumber in the middle of the screen.
Maybe if you told WHY you need it in the middle of the screen we could assist better.
Currently we are putting in report footer small row which contains:number of pages, pages in envelope and some id's. Our clients want to have full A4 format white area for their data to put on, so some clients don't want to have any such rows(because it may increase number of pages). There is a padding left 2cm on each page, which is white area, there we should put that info in vertical position some how. Know what I mean?
Do you have more then 1 detail per page?
Yes, more than one. If only one it would be easy :)
Does the detail contain any controls that can grow/shrink?
This is the simplest approach I can come up with.
1) Place a label on your detail event. In my example I just named it lbl_Example, though lbl_Page probably would have been a better name :P
2) Add this code to your reports module: - Private Const lngPageTop As Long = 7400 'Aprox placement of middle of page
-
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
-
Dim lngTop As Long
-
lngTop = Me.Top
-
'Assuming that a detail is no more then 2000 twips height
-
'Problem here is that me.height is the height BEFORE controls grow.
-
If Me.Top > lngPageTop - Me.Height And Me.Top < lngPageTop Then
-
Me.lbl_Example.Caption = Page
-
Me.lbl_Example.Visible = True
-
-
'Reposition label to same position each time
-
Me.lbl_Example.Top = lngPageTop - Me.Top
-
-
Else
-
-
Me.lbl_Example.Visible = False
-
End If
-
-
-
End Sub
Basicly the code tries to estimate whether or not the "middle" of page will be contained within the current detail, and if so, reposition and show the label.
The problem with this approach is that Me.Height is the details "design" height, it doesn't take growing controls into account. If you want to modify it to include growing controls, the best you can do is to use Stephen Levans code to guestimate the control height. I have used it quite successfully to force page brakes at specific locations in my reports, by guesstimating whether or not the next item would be able to fit on the page or not.
Code is nice, but what if 1 group may have 4 pages, will that label be on each page or just on a first one? I guess I have too look at Stephen Lebans tricks
Hmm...didn't think of that. If a detail goes across more then 1 page, I don't think my suggestion would work.
Thanks for the quick replies. So I guess it is not possible. Right?
I dont usually go so far as to say that things are not possible. But I would say its close.
It would be quite cumbersome to deal with all the special cases, and to be honest it doesn't seem worth the hazzle.
OK, I have another approach (Which is why I usually don't say that things are impossible.)
Here is what I did:
In the Page event of the report, I used the following code: - Private Sub Report_Page()
-
'Store old font values
-
Dim strCurrentFont As String
-
Dim intCurrentFontSize As Integer
-
Dim intCurrentScaleMode As Integer
-
-
strCurrentFont = Me.FontName
-
intCurrentFontSize = Me.FontSize
-
intCurrentScaleMode = Me.ScaleMode
-
-
'Set font values for our pagelabel
-
Me.FontName = "Times New Roman"
-
Me.ScaleMode = 3
-
Me.FontSize = 16
-
-
'Print to page
-
Me.CurrentX = 50
-
Me.CurrentY = 3000
-
Me.Print Page()
-
-
'Reset to old values
-
Me.FontName = strCurrentFont
-
Me.FontSize = intCurrentFontSize
-
Me.ScaleMode = intCurrentScaleMode
-
End Sub
This will print the page number on the page, at the location specified by CurrentX and CurrentY.
I have never used the page event before, so I honestly don't know if there are any issues/problems with this method, but my admittedly short testing didn't reveal any issues.
Great! That is what I need. Never thought about "Me.Print Page()" Thanks for the help.
Is it possible to print that in vertical orientation?
You want the label turned 90 degrees? Or to be printed on a report that is turned?
Just a label 90 degrees. That will be enough :)
Nothing springs to mind. Access must have some method for printing the vertical labels you can make, but I don't know how to find/use it.
I honestly don't know of hand (nor after an hour spent), how to modify it for reports.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: will |
last post by:
Hope someone can help me here, as I can't find the answer anywhere.
I'm printing documents using XML and XSL:FO. The documents are
double-sided. I want to number the pages so that the physical...
|
by: Elasho |
last post by:
I have a report that groups data on an Area, the report is set to force a
new page for each Area within the report.
Each Area will have 1 or more pages.
Is it possible to make the page...
|
by: Simon |
last post by:
Dear reader,
Most of the reports have a page numbering as Page x of nn, starting at the
first page 1 (one) to the last page nn.
But know I need to start with Page 1 of nn for each...
|
by: joelpollock |
last post by:
I'm having trouble continuously page numbering a large report in MS
Access. The report is made up of three separate Access reports which I
join together at the end.
In the past I have opened the...
|
by: ravib |
last post by:
how to transfer one page to an other page through middle page in javascript
| |
by: jimratajski |
last post by:
Can anyone tell me how to automate page numbering of spawned page templates in Acrobat? I have a number of forms containing hidden page templates that I would like to be auto numbered as they are...
|
by: bhughes2187 |
last post by:
I am trying to sequentially place page numbers across multiple reports.
Basically what I am trying to do is on the first report, which has 3 pages, the first page is page one...after cycling through...
|
by: booher |
last post by:
I need help generating a PDF output where the page numbering restarts at 1 with every new chapter in a document. So the output would look something like 1-1, 1-2, 1-3,..., 2-1, 2-2, 2-3,...
I'm...
|
by: oranoos3000 |
last post by:
hi
I have a login page in my site for login member
I want to any user that arrival correctly directly go to page1.php
I use header statement(header("Location: page1.php"))
in middle page that...
|
by: Reedsp |
last post by:
I have a report that displays the page numbering incorrectly. Example page 1 of 3 but only 2 pages are displayed when previewing or printing the report. Here is the details:
Page footer - text...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |