Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No way to tell if Print button was pressed on Preview?!
Message
 
À
01/08/1997 11:48:42
Gino Miceli
Lan Professionals, Inc.
Bay Shore, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00042331
Message ID:
00042811
Vues:
29
Gino,

I may have to agree with Arnon on this one. Here's why:

Now I'm using the assumption that the function is being called from a Print When for a field in the title band. If that's correct, a little test I ran a preview from the command window, setting up a global variable that a function incremented. The debugger showed the value of this variable to be 40 on the first page. In other words, even though that print when function was only on one field in the title band, for some reason it hit the function 40 times. The reason I chose to use a numeric rather than a logical variable was to see how many times the function was actually called. While I suspected that it might actually be called once per page, I had no idea that it might be called multiple t8imes even in the title band. Not only that, but the value kept incrementing as I moved back and forth through the pages. The values were even higher when the field was placed in the page heading. While this wasn't in an executable, I have no reason to believe that the results would be any different.

Now if my assumption about where the function is placed is incorrect, please let me know where it is placed.

George

>Actually, if you look carefully at Valerie's idea, you'll find that it does work 100%
>of the time...
>
>The Title band is only executed ONCE at the beginning of a PRINT or the beginning
>of a PREVIEW
>
>If the user wants to PREVIEW, we set glPrinted=.T. .. If they just preview, the
>title band will run once, setting glPrinted to .F. If after they view the preview
>they click the Print button (which can only be done once), glPrinted is set back
>to .T. (You could also use something like gnPrinted = 0 and increment it in the
>title band and check the count.)
>
>If the user PRINTS, we set glPrinted to .F., and it is toggled once to .T. I haven't
>tested what printing more than one copy does, but I'm hoping it generated the form,
>then prints the multiple copies.
>
>So Valerie, you look like you're in the clear!
>
>
>
>>I've found no way to trap it - finally I just removed it from the toolbar
>>(for places where it matters)
>>
>>Arnon
>>
>>>
>>>I am finding it hard to believe that our old Big Brother MS has provided us
>>>NO WAY to tell if the Print button was pressed on the Print Preview
>>>toolbar. Maybe there's a way to trap the event by going to the API? Any
>>>suggestions?
>>>
>>>
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform