KB-32772: Printing the application’s screens.

Question:

How can I print a screen?

Solution:

The following example illustrates how to print the current screen with a button click. First of all, you will need to create a formatted report. To do so, follow these procedures:

  1. Access the Organizer (Alt+O) and select the item Report.
  2. Click New and select Formatted Report.
  3. While selecting Report (Form1), click on Edit.
  4. Insert a Bitmap object onto the report (Objects->Bitmap) with the appropriate size; 
  5. Close the report’s window.

Then, it will be necessary to set up a button to print the report. To do so, follow these procedures:

  1. Insert a button onto screen that will access its properties with a double click.
  2. Go to Scripts tab and click New.
  3. Select OnRelease event and click on OK.
  4. Paste the following script in the new event:
CaptureScreen(“C:\test.bmp”) //saves screen capture in a file in the hard disk
Bitmap1.bitmapName = “test.bmp” //configures the bitmap in the formatted report with the figure of the captured screen
Form1.Print() //prints screen

NOTE: The printer used by the report is set up in Organizer->Reports->My Report -> Printer

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *