Lines - print different to whats on screen

V

Vayse

Hi
Marshall Barton replied to my previous post, with code as below, to create a
'roundy rectangle'
And all worked well. Or so I thought.
The report looked fine on screen, and printed fine. However, if coverted to
snapshot, the thinkness of the line greatly increased, so that all the
rectangles merged together.
Likewise if converted to PDF - we're using a third party app - Win2PDF.

The report is a main report with around 10 sub reports. I couldn't figure
out what the problem was, so I created a brand new main report. Then I
inserted the sub reports in.
Lets call the original report rptOrig, and the new rptNew.
On rptOrig, the DrawWidth had been 120. For whatever reason, this was too
thick on rptNew, so I set it to 45.
rptNew looks fine on screen. Converts to PDF fine. However, it has its own
problems:
1) When printed from Access, the lines are much thinner. And black, as
opposed to Grey.
2) When converted to snapshot, the lines are thinner here also.

I can workaround the printing issue, by converting to PDF and printing from
there. However, I'd like to understand what the issue is.

Any ideas?

Thanks
Vayse


'*************************************************************
Const R As Long = 100
Const Pi As Double = 3.14159265
Const LineWidth As Long = 45
Const LineForeColour As Long = 12632256

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

On Error GoTo Err_Format

Me.ForeColor = LineForeColour
Me.DrawWidth = LineWidth

' Roundy rectangle aroudn the outline of the report
Roundy ("rptPolicyTop")
Roundy ("rptMortgage_Summary")

Exit_Format:
Exit Sub

Err_Format:
msgError (Me.Name)
Resume Exit_Format

End Sub


Private Sub Roundy(stReport As String)

With Me(stReport)
Me.Line (.Left, .Top + R)-(.Left, .Top + .Height - R)
Me.Circle (.Left + R, .Top + R), R, , 0.5 * Pi, Pi
Me.Line (.Left + R, .Top)-(.Left + .Width - R, .Top)
Me.Circle (.Left + .Width - R, .Top + R), R, , 0, 0.5 * Pi
Me.Line (.Left + .Width, .Top + R)-(.Left + .Width, .Top + .Height -
R)
Me.Circle (.Left + .Width - R, .Top + .Height - R), R, , 1.5 * Pi, 2
* Pi
Me.Line (.Left + R, .Top + .Height)-(.Left + .Width - R, .Top +
..Height)
Me.Circle (.Left + R, .Top + .Height - R), R, , Pi, 1.5 * Pi
End With

End Sub
 
S

Stephen Lebans

The issue has to do with how the Report object Line and Circle methods are
encoded within the Snapshot, specifically how they are tranlsated to GDI
BltBit calls. You have no control over this logic.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
V

Vayse

Thanks! Re snapshot - fair enough. But why does this also apply to the
printing from within Access? Do the same GDI BltBit call apply there as
well?

It looks like this could be an issue for me. Its not at the moment, but I am
worried that if I change my report that the PDF would stop working.
Is there an alternative to using the line and circle statements?
 
S

Stephen Lebans

When Access prints to the printer or to a Snapshot file(no difference) the
output is converted to an Enhanced Metafile(EMF). .Each record of the EMF is
itself a recording of a GDI call corresponding to some element of the report
to be rendered. It's a lot more technical than that but you get the idea.

AFAIK there is no VBA alternative to what Marshall posted. You could instead
use an Image control containing the desired rounded rectangle that you would
resize at run time.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
V

Vayse

Interesting.
It would be a lot more difficult to do using an image control, and would
probably not look as well.
As long as the PDF works, I'll continue to use Marshalls method.
Thanks
Diarmuid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top