Report. Scale-Methode (Access)Report.Scale method (Access)
Die Scale -Methode definiert das Koordinatensystem für ein Report -Objekt.The Scale method defines the coordinate system for a Report object.
SyntaxSyntax
Ausdruck. Skalierung (Flags, x1, Y1, x2, Y2)expression.Scale (Flags, x1, y1, x2, y2)
Ausdruck Eine Variable, die ein Report -Objekt darstellt.expression A variable that represents a Report object.
ParameterParameters
NameName | Erforderlich/OptionalRequired/Optional | DatentypData type | BeschreibungDescription |
---|---|---|---|
FlagsFlags | ErforderlichRequired | IntegerInteger | |
x1x1 | ErforderlichRequired | SingleSingle | Ein Wert für die horizontale Koordinate, die die obere linke Ecke des Objekts definiert.A value for the horizontal coordinate that defines the position of the upper-left corner of the object. |
Y1y1 | ErforderlichRequired | SingleSingle | Ein Wert für die vertikale Koordinate, die die Position der oberen linken Ecke des Objekts definiert.A value for the vertical coordinate that defines the position of the upper-left corner of the object. |
x2x2 | ErforderlichRequired | SingleSingle | Ein Wert für die horizontale Koordinate, die die untere rechte Ecke des Objekts definiert.A value for the horizontal coordinate that defines the position of the lower-right corner of the object. |
Y2y2 | ErforderlichRequired | SingleSingle | Ein Wert für die vertikale Koordinate, die die untere rechte Ecke des Objekts definiert.A value for the vertical coordinate that defines the position of the lower-right corner of the object. |
RückgabewertReturn value
NichtsNothing
BemerkungenRemarks
Sie können diese Methode nur in einer Ereignisprozedur oder einem Makro verwenden, das durch **** die OnPrint-oder OnFormat-Ereigniseigenschaft für einen Bericht angegeben wird, oder die OnPage-Ereigniseigenschaft für einen Bericht. **** ****You can use this method only in an event procedure or a macro specified by the OnPrint or OnFormat event property for a report section, or the OnPage event property for a report.
Sie können die Scale -Methode verwenden, um das Koordinatensystem auf eine beliebige Skala zurückzusetzen, die Sie auswählen.You can use the Scale method to reset the coordinate system to any scale that you choose. Wenn Sie die Scale -Methode ohne Argumente verwenden, wird das Koordinatensystem auf Twipszurückgesetzt.Using the Scale method with no arguments resets the coordinate system to twips. Die Scale -Methode wirkt sich auf das Koordinatensystem für die Print -Methode und die Report Graphics-Methoden aus, einschließlich der Methoden Circle, Linieund PSet .The Scale method affects the coordinate system for the Print method and the report graphics methods, which include the Circle, Line, and PSet methods.
BeispielExample
Im folgenden Beispiel wird ein Kreis mit einer Skala gezeichnet, und anschließend wird **** die Scale-Methode verwendet, um die Skalierung zu ändern und einen weiteren Kreis mit der neuen Skala zu zeichnen.The following example draws a circle with one scale, and then uses the Scale method to change the scale and draw another circle with the new scale.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
DrawCircle
End Sub
Sub DrawCircle()
Dim sngHCtr As Single, sngVCtr As Single
Dim sngNewH As Single, sngNewV As Single
Dim sngRadius As Single
Me.ScaleMode = 3 ' Set scale to pixels.
sngHCtr = Me.ScaleWidth / 2 ' Horizontal center.
sngVCtr = Me.ScaleHeight / 2 ' Vertical center.
sngRadius = Me.ScaleHeight / 3 ' Circle radius.
' Draw circle.
Me.Circle (sngHCtr, sngVCtr), sngRadius
' New horizontal scale.
sngNewH = Me.ScaleWidth * 0.9
' New vertical scale.
sngNewV = Me.ScaleHeight * 0.9
' Change to new scale.
Me.Scale(0, 0)-(sngNewH, sngNewV)
' Draw circle.
Me.Circle (sngHCtr + 100, sngVCtr), sngRadius, RGB(0, 256, 0)
End Sub
Support und FeedbackSupport and feedback
Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation?Have questions or feedback about Office VBA or this documentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.