Printed Form Interception

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

I have the following task: There is a command which should handle opened printed forms, how can I enumerate them?

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Jul 20, 2011
Company:

There is a solution for the managed application mode. You can use GetWindows() function to enumerate the opened windows and then check in some way if this window contains the printed form. For example you can add a caption part “PrintedForm” for all windows with printed forms.
The part of the printed form generation code:

Code
//{{_PRINT_WIZARD(Print)
Spreadsheet = New SpreadsheetDocument;
...
Spreadsheet.Show("PrintedForm");
//}}
The command to handle opened windows:
&AtClient
Procedure ProcessPrintedFormWindows(Command)
    OpenedWindows = GetWindows();
    For Each Window In OpenedWindows Do
        WindowCaption = Left(Window.Caption, 11);
        If WindowCaption = "PrintedForm" Then
            // Your code here
        EndIf;
    EndDo;
EndProcedure

This won't work in the Ordinary Application mode.

 
Subscribe
Be the first to know tips & trick on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.