How can I set custom vertical alignment for a section?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As you know, there is one section on every report, page footer, that prints at the bottom of the page. Is there a way for a user to set other sections to print as low as possible as well, instead of as high as possible, as every section does by default? I have a client that wants me to place a section just above the page footer section, rather than just below the last group footer or whatever. It only needs to appear on the last page of an invoice, so I don't want to include the controls in the page footer section, since they're not needed on earlier page footers

It does not appear that the CurrentX variable will allow me to move an entire section

If this ability is not already in Access, I hope Microsoft will add it to the product

Thank you
Ed Tuggy
 
Could you add the controls to the page footer and make them invisible on all
but the last page? You could use code in the on format event of the page
footer to see if [Page] = [Pages].

--
Duane Hookom
MS Access MVP


Ed Tuggy said:
As you know, there is one section on every report, page footer, that
prints at the bottom of the page. Is there a way for a user to set other
sections to print as low as possible as well, instead of as high as
possible, as every section does by default? I have a client that wants me to
place a section just above the page footer section, rather than just below
the last group footer or whatever. It only needs to appear on the last page
of an invoice, so I don't want to include the controls in the page footer
section, since they're not needed on earlier page footers.
 
Duane,
The reason I haven't done that is because these controls take up about 1.5 inches, so they would leave a large empty area at the bottom of each non-final page. Another reason is that I want the controls to appear at the bottom of each invoice, not necessarily at the bottom of each report.

Thanks,
Ed
 
You might be able to do this by removing your invoice details from the main
report and placing them in a "sized" subreport. The size of the subreport
might be enough to push the section toward the bottom of the page.
The only other alternative that I can think of is to use code in the On Page
event. The code would have to accumulate all the values and use Me.Print to
print them near the bottom.

--
Duane Hookom
Microsoft Access MVP


Ed Tuggy said:
Duane,
The reason I haven't done that is because these controls take up about 1.5
inches, so they would leave a large empty area at the bottom of each
non-final page. Another reason is that I want the controls to appear at the
bottom of each invoice, not necessarily at the bottom of each report.
 
Your last sentence interests me. Can you explain a little more fully how I could use code in the On Page event and use Me.Print to print items near the bottom? Are we getting close to the idea of vertical alignment = bottom rather than top? The way I conceive it, one would have to know the section's top position, how tall the page is, how much the bottom margin is, how much space to reserve for the page footer section, and if there is enough blank space left, move the top of my custom footer down by an amount equal to the surplus space, then begin printing just above the page footer. But I'm not sure how to obtain all that information programmatically. Am I explaining myself

Thanks
Ed Tugg

----- Duane Hookom wrote: ----

You might be able to do this by removing your invoice details from the mai
report and placing them in a "sized" subreport. The size of the subrepor
might be enough to push the section toward the bottom of the page
The only other alternative that I can think of is to use code in the On Pag
event. The code would have to accumulate all the values and use Me.Print t
print them near the bottom

--
Duane Hooko
Microsoft Access MV


Ed Tuggy said:
Duane
The reason I haven't done that is because these controls take up about 1.
inches, so they would leave a large empty area at the bottom of eac
non-final page. Another reason is that I want the controls to appear at th
bottom of each invoice, not necessarily at the bottom of each report
 
I tried code like the following and it seemed to work. I'm not sure how it
would work if the groups span multiple pages.
Option Compare Database
Option Explicit
Dim curTotal As Currency 'variable to store value for later printing

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
curTotal = Me.txtSumQty
End Sub
Private Sub Report_Page()
Me.CurrentX = 200
Me.CurrentY = 9.5 * 1440
Me.FontSize = 20
Me.Print curTotal 'print the total
End Sub

--
Duane Hookom
MS Access MVP


Ed Tuggy said:
Your last sentence interests me. Can you explain a little more fully
how I could use code in the On Page event and use Me.Print to print items
near the bottom? Are we getting close to the idea of vertical alignment =
bottom rather than top? The way I conceive it, one would have to know the
section's top position, how tall the page is, how much the bottom margin is,
how much space to reserve for the page footer section, and if there is
enough blank space left, move the top of my custom footer down by an amount
equal to the surplus space, then begin printing just above the page footer.
But I'm not sure how to obtain all that information programmatically. Am I
explaining myself?
 
Duane

In case you're interested, here is how I was able to make a "logical group" of controls print at the bottom of the page just above the page footer. First, I selected the group of controls and in the property sheet I set the tag to "Alignment=Bottom". Then I used the following code to find the amount of white space, enlarge the section height by that amount, and move all the controls with that tag to the bottom of the section. Then, the next time the header for that section was formatted, I reset the position of the controls and the height of the section, preventing accumulation of the changes.

Hope you find this interesting and useful

Thanks for your help

Ed Tugg
edtuggy at sierratel dot com or sti dot ne

Private Sub GroupFooter3_Format(Cancel As Integer, FormatCount As Integer
On Error GoTo Err_Handle

Dim ctl As Contro

If Printable_Height > (Me.Top + Me.GroupFooter3.Height + Me.PageFooterSection.Height) The
White_Space = Printable_Height - Me.Top - Me.GroupFooter3.Height - Me.PageFooterSection.Height - 2
Me.GroupFooter3.Height = Me.GroupFooter3.Height + White_Spac

For Each ctl In GroupFooter3.Control
If ctl.Tag = "Alignment=Bottom" The
ctl.Top = ctl.Top + White_Spac
End I
Nex
End I

Exit_Handler
Exit Su

Err_Handler
MsgBox Err.Descriptio
Resume Exit_Handle
End Su

Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer
On Error GoTo Err_Handle

Dim ctl As Contro

For Each ctl In GroupFooter3.Control
If ctl.Tag = "Alignment=Bottom" The
ctl.Top = ctl.Top - White_Spac
End I
Nex

Me.GroupFooter3.Height = Me.GroupFooter3.Height - White_Spac

Exit_Handler
Exit Su

Err_Handler
MsgBox Err.Descriptio
Resume Exit_Handle
End Su

----- Duane Hookom wrote: ----

I tried code like the following and it seemed to work. I'm not sure how i
would work if the groups span multiple pages
Option Compare Databas
Option Explici
Dim curTotal As Currency 'variable to store value for later printin

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer
curTotal = Me.txtSumQt
End Su
Private Sub Report_Page(
Me.CurrentX = 20
Me.CurrentY = 9.5 * 144
Me.FontSize = 2
Me.Print curTotal 'print the tota
End Su

--
Duane Hooko
MS Access MV


how I could use code in the On Page event and use Me.Print to print item
near the bottom? Are we getting close to the idea of vertical alignment
bottom rather than top? The way I conceive it, one would have to know th
section's top position, how tall the page is, how much the bottom margin is
how much space to reserve for the page footer section, and if there i
enough blank space left, move the top of my custom footer down by an amoun
equal to the surplus space, then begin printing just above the page footer
But I'm not sure how to obtain all that information programmatically. Am
explaining myself
 
Back
Top