Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I know if report is printed?
Message
De
08/08/2006 03:42:03
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01140994
Message ID:
01143709
Vues:
83
This message has been marked as the solution to the initial question of the thread.
Hi, PDMFJI,

I like to give you my solution. It works for me. But it is a little tricky.
For the first we have a problem with Reportbehavior 90.

We need to decide if we print with or without preview.. Because of the Rendering system there are small differnces. For non preview reports we need simply to check if te report is not canceled via ESC. In preview the report is completely rendered on the point we decide to print so no report band or the like is activated.

What I do is a small trick with eventbinding

I need a method called "ReportEnd"like
LPARAMETERS;
 tlPrint

*FYI:
#DEFINE dcPrintWindow_uk	'Printing...'
#DEFINE dcPrintWindow_deu	'Drucken...'

LOCAL;
 lnEvents AS INTEGER,;
 lnEvent  AS INTEGER,;
 llEvent  AS BOOLEAN

LOCAL ARRAY;
 laAvents(1,3)

lnEvents = AEVENTS(laEvents,THIS)

FOR lnEvent = 1 TO lnEvents
 IF laEvents(lnEvent,1) AND LOWER(laEvents(lnEvent,4))=('reportend') THEN
  llEvent = True
  EXIT
 ENDIF &&laEvents(lnEvent,1) AND LOWER(laEvents(lnEvent,4))=('reportend')
ENDFOR &&lnEvent

IF llEvent THEN
 IF !EMPTY(AEVENTS(laEvents,0)) THEN
*supress VFP 8 style call from frx, if the summary band still holds the call
  DO CASE
   CASE !laEvents(1,1).BASECLASS='Reportlistener'
   CASE LOWER(laEvents(1,2))=('cancelreport')
    THIS.glPrinted = False
   CASE LOWER(laEvents(1,2))=('onpreviewclose') AND !tlPrint
    THIS.glPrinted = False
  ENDCASE
 ENDIF &&!EMPTY(AEVENTS(laEvents,0))
ELSE &&llEvent
*this is for REPORTBEHAVIOR 80 and needs a call to this method in summary band
 THIS.glPrinted = ;
  WEXIST(dcPrintWindow_Deu) OR;
  WEXIST(dcPrintWindow_Uk)
ENDIF &&llEvent
I call the report from a form like:
toListener = .NULL.
DO (_REPORTOUTPUT) WITH tnListenerType,toListener

THIS.glPrinted = .T.
BINDEVENT(toListener,'CancelReport'  ,THIS,'ReportEnd',1)
BINDEVENT(toListener,'OnPreviewClose',THIS,'ReportEnd',1)

REPORT FORM myReport OBJECT toListener

UNBINDEVENTS(toListener,'OnPreviewClose',THIS,'ReportEnd')
UNBINDEVENTS(toListener,'CancelReport'  ,THIS,'ReportEnd')

*If THIS.glPrinted is false, the report was not send to any spooler
HTH

Agnes

>I tried the technique in the mentioned message but found that it only works when ReportBehaviour=80:
>
>The following works, i.e. llprinted set to "2" when printed:
> report form xxx to printer prompt preview
>
>But the followind doesn't, llprinted still set to "1" even when printed:
> report form xxx to printer prompt object type 1
>
>Am I doing something wrong here?
>
>
>>Check Message #984462
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform