PrintPreview

<< Click to Display Table of Contents >>

 

PrintPreview

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

Generates a printing preview of a Section Report on screen. If the Section Report is correctly shown on screen, returns True. If users click Cancel or an error occurs, returns False. The Left and Top parameters indicate the position of the printing preview, in pixels, from screen's upper left corner. The Width and Height parameters indicate the size of the printing preview on screen, in pixels or Himetric. All parameters are optional. The next script contains an example of using this method.

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

 

NOTES

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

This method corresponds to Pick Print Report.

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

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

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

Was this page useful?