Connecting Tech Pros Worldwide Help | Site Map

Print Output

  #1  
Old November 13th, 2005, 09:28 AM
Brian Keanie
Guest
 
Posts: n/a
If controls on a report have the CanShrink and CanGrow properties set to
"Yes" how then can you format your print output? other than leaving it to
the smarts of access
Don't want to show my age or lack of expertise but I'm thinking back to
Basic Basic when you had to know how many lines were going to be printed on
a page etc. Surely there must be the same requirement in access on occasion.
Could someone direct me to a site or correspondence to explain this?
In case you didn't recognize the relationship this has to do with my OLE
quandry.


  #2  
Old November 13th, 2005, 09:30 AM
bruce@aristotle.net
Guest
 
Posts: n/a

re: Print Output


"How can you format your print output" is a pretty broad question.
However, looking at the threads regarding your OLE quandary, I think
the answer to your question lies in your report's Detail Format event
as Stephen Lebans mentioned. Try adding the following code to your
report:

In the General Declarations section add the following
declarations:

Dim mlngDetailDefaultHeight As Long
Dim mlngOLEDefaultHeight As Long

Then modify your Report_Open and Detail_Format event code as follows:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If IsNull(OLEBound1) Then
OLEBound1.Height = 0
OLEBound1.Visible = False
Me.Detail.Height = 0
Else
OLEBound1.Visible = True
OLEBound1.Height = mlngOLEDefaultHeight
Me.Detail.Height = mlngDetailDefaultHeight
End If

End Sub

Private Sub Report_Open(Cancel As Integer)

' Save the default height of the OLE control and the
' detail section it is in.
mlngOLEDefaultHeight = OLEBound1.Height
mlngDetailDefaultHeight = Me.Detail.Height

End Sub

HTH,
Bruce

  #3  
Old November 13th, 2005, 09:30 AM
bruce@aristotle.net
Guest
 
Posts: n/a

re: Print Output



bruce@aristotle.net wrote:[color=blue]
> "How can you format your print output" is a pretty broad question.
> However, looking at the threads regarding your OLE quandary, I think
> the answer to your question lies in your report's Detail Format event
> as Stephen Lebans mentioned. Try adding the following code to your
> report:
>
> In the General Declarations section add the following
> declarations:
>
> Dim mlngDetailDefaultHeight As Long
> Dim mlngOLEDefaultHeight As Long
>
> Then modify your Report_Open and Detail_Format event code as follows:
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
>
> If IsNull(OLEBound1) Then
> OLEBound1.Height = 0
> OLEBound1.Visible = False
> Me.Detail.Height = 0
> Else
> OLEBound1.Visible = True
> OLEBound1.Height = mlngOLEDefaultHeight
> Me.Detail.Height = mlngDetailDefaultHeight
> End If
>
> End Sub
>
> Private Sub Report_Open(Cancel As Integer)
>
> ' Save the default height of the OLE control and the
> ' detail section it is in.
> mlngOLEDefaultHeight = OLEBound1.Height
> mlngDetailDefaultHeight = Me.Detail.Height
>
> End Sub[/color]

I forgot to mention that this assumes your OLE control is named
'OLEBound1'. If it's named differently, replace appropriately. Also,
you can probably get away with declaring your height storage variables
as integer rather than long, e.g.

Dim mintDetailDefaultHeight As Integer
Dim mintOLEDefaultHeight As Integer

HTH,
Bruce

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stylesheet not applied to the print output from CrystalReportViewer Karthik answers 0 February 15th, 2007 05:45 AM
Is it possible to capture print output Salad answers 2 November 12th, 2005 11:59 PM
Print output before program end Rafal Lagowski answers 1 July 19th, 2005 06:02 AM
Print Output from log File Sure answers 0 July 17th, 2005 10:19 AM