PrintPreview

<< Click to Display Table of Contents >>

 

PrintPreview

PrintPreview([Left], [Top], [Width], [Height])

Generates a printing preview of a Report on screen. If the Report is correctly displayed on screen, returns True. If users click Cancel or any error occurs, returns False. The Left and Top parameters indicate the position of the printing preview, in pixels, starting from the upper left corner of the screen. The Width and Height parameters indicate the size of the printing preview on screen, in pixels or Himetric. All parameters are optional. Example:

Sub CommandButton1_Click()
  Set report = Application.LoadReport("[Report1]")
  Start = Application.GetObject("Data.Chart.datas").Value
  Ending = Application.GetObject("Data.Chart.datae").Value
  report.Item("Query1").SetVariableValue "Begin", Start
  report.Item("Query1").SetVariableValue "End", Ending
  report.PrintPreview()
End Sub

 

NOTES

This method is not available for Reports loaded using Server's LoadReport method.

This method corresponds to the Print Report Pick.

If the Left and Top parameters are not defined, the printing preview is displayed at position (0, 0).

If the Width and Height parameters are not defined, the printing preview is created with 500 by 500 pixels and the window is opened maximized. If only one of these parameters is defined, the other parameter is configured with 500 pixels and the window is not opened maximized.

Size values for this method can be informed as numbers or Strings. In case of numbers, they are considered as pixels. In case of Strings, if they are followed by an "hm" unit, they are interpreted as Himetric. Any other case is considered as pixels.

Was this page useful?