dbTalk Databases Forums  

Preview mode with pause, capture user abort

comp.databases.filemaker comp.databases.filemaker


Discuss Preview mode with pause, capture user abort in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christoph Kaufmann
 
Posts: n/a

Default Preview mode with pause, capture user abort - 12-12-2005 , 09:07 AM






In FMP 8, I go to a layout which is for print only, set preview mode
with pause.

The user is to decide whether to continue (to print) or abort.

If he does decide to abort, he ends up in the print layout. I'd prefer
he didn't. Can I capture this abort in the script?
--
http://clk.ch

Reply With Quote
  #2  
Old   
Grip
 
Posts: n/a

Default Re: Preview mode with pause, capture user abort - 12-12-2005 , 11:46 AM






I'm not sure about capturing the abort in the script, but you can set
User Abort Off. Then in the step after
Enter Preview Mode (Pause)
put in a
Show Custom Dialog i.e. "Do you want to print this page?" With Yes No.

You CAN capture that with an
If(GetLastMessageChoice)=1; Print
End If
Go to Layout (Other)
Enter Browse Mode


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Preview mode with pause, capture user abort - 12-12-2005 , 01:43 PM



In article <g94rp1huk5haqjkdm77i0p14kphnlpf843 (AT) 4ax (DOT) com>, Christoph
Kaufmann <clk (AT) freesurf (DOT) ch> wrote:

Quote:
In FMP 8, I go to a layout which is for print only, set preview mode
with pause.

The user is to decide whether to continue (to print) or abort.

If he does decide to abort, he ends up in the print layout. I'd prefer
he didn't. Can I capture this abort in the script?
You can't actually "capture" the abort click, but you can remove that
option by using the Allow User Abort [Off] script command. This means
the user can't abort the script and you can use a custom message window
as others have suggested to ask if they want to print it or not.

Basically your script becomes:

Go To Layout [PrintLayout]
Allow User Abort [Off]
Enter Preview Mode [Pause]
Show Message ["Do you want to print?", "Yes", "No"]
If [Get(Current Message Choice) = 1]
Page Setup [Restore, No Dialog]
Print []
End If
Go To Layout [DataEntryLayout]


The Allow User Abort command automatically turns on when the script
ends.

You might want to use the Print [No Dialog] command instead of just
Print [], but it's usually best to allow the user to specify what pages
and how many copies they want to print, etc.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Preview mode with pause, capture user abort - 12-12-2005 , 03:26 PM



In article <131220050843202941%helpful_harry (AT) nom (DOT) de.plume.com>, Helpful
Harry <helpful_harry (AT) nom (DOT) de.plume.com> wrote:

Quote:
In article <g94rp1huk5haqjkdm77i0p14kphnlpf843 (AT) 4ax (DOT) com>, Christoph
Kaufmann <clk (AT) freesurf (DOT) ch> wrote:

In FMP 8, I go to a layout which is for print only, set preview mode
with pause.

The user is to decide whether to continue (to print) or abort.

If he does decide to abort, he ends up in the print layout. I'd prefer
he didn't. Can I capture this abort in the script?

You can't actually "capture" the abort click, but you can remove that
option by using the Allow User Abort [Off] script command. This means
the user can't abort the script and you can use a custom message window
as others have suggested to ask if they want to print it or not.

Basically your script becomes:

Go To Layout [PrintLayout]
Allow User Abort [Off]
Enter Preview Mode [Pause]
Show Message ["Do you want to print?", "Yes", "No"]
If [Get(Current Message Choice) = 1]
Page Setup [Restore, No Dialog]
Print []
End If
Go To Layout [DataEntryLayout]


The Allow User Abort command automatically turns on when the script
ends.

You might want to use the Print [No Dialog] command instead of just
Print [], but it's usually best to allow the user to specify what pages
and how many copies they want to print, etc.
Actually I've just realised that's not right, you CAN capture the
Cancel button click using the Set Error Capture command and the
Get(Current Error) function.

The Set Error Capture [On] command stops FileMaker from intercepting
the rrors and let's you handle them in your script however you want.

This means your script could be something like:

Go To Layout [PrintLayout]
Set Error Capture [On]
Enter Preview Mode [Pause]
If [Get(Current Error) = 0]
Set Error Capture [Off]
Page Setup [Restore, No Dialog]
Print []
End If
Set Error Capture [Off]
Go To Layout [DataEntryLayout]

First you turn off FileMaker's interception of the errors, then when
the user exits Pause mode clicking the Cancel button should cause an
error to occur which can be checked using the Get(Current Error)
function - if the user click Continue then there was no error and
Get(Current Error) = 0 and you can print, otherwise the user must have
clicked Cancel and you can skip that and return to the DataEntryLayout.

The Set Error Capture command will turn off again automatically after
the script has finished, but it's probably best to do that yourself
before processing the Print commands since that will give FileMaker
back the ability to handle any printing errors.


BUT
the Allow User Abort option is better since that stops users being able
to switch layouts, etc. manually. and they HAVE to finish previewing
the report layout.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #5  
Old   
Christoph Kaufmann
 
Posts: n/a

Default Re: Preview mode with pause, capture user abort - 12-13-2005 , 01:55 PM



Helpful Harry <helpful_harry (AT) nom (DOT) de.plume.com> wrote:

Quote:
Basically your script becomes:

Go To Layout [PrintLayout]
Allow User Abort [Off]
Enter Preview Mode [Pause]
Show Message ["Do you want to print?", "Yes", "No"]
If [Get(Current Message Choice) = 1]
Page Setup [Restore, No Dialog]
Print []
End If
Go To Layout [DataEntryLayout]

I couldn't get to work that script properly, even though I copied all
the steps the script would simply halt in the print layout.

Quote:
the Allow User Abort option is better since that stops users being able
to switch layouts, etc. manually. and they HAVE to finish previewing
the report layout.
Thanks for the hint - I was not aware of the benefits of this step. I
use it now and go to the print step after the user has continued. The
the print step allows the user to abort.
--
http://clk.ch


Reply With Quote
  #6  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Preview mode with pause, capture user abort - 12-13-2005 , 05:46 PM



In article <1h7j0jr.8ksrwx1c9zzuyN%clk (AT) freesurf (DOT) ch>, clk (AT) freesurf (DOT) ch
(Christoph Kaufmann) wrote:

Quote:
Helpful Harry <helpful_harry (AT) nom (DOT) de.plume.com> wrote:

Basically your script becomes:

Go To Layout [PrintLayout]
Allow User Abort [Off]
Enter Preview Mode [Pause]
Show Message ["Do you want to print?", "Yes", "No"]
If [Get(Current Message Choice) = 1]
Page Setup [Restore, No Dialog]
Print []
End If
Go To Layout [DataEntryLayout]

I couldn't get to work that script properly, even though I copied all
the steps the script would simply halt in the print layout.
Errr ... that's what it's supposed to do, pause in Preview mode to show
the user what the printou will look like. The user can then click the
"Continue" button in the window's side toolbar / statusbar and the
script continues running. If you're hiding that toolbar you may need to
add another couple of lines to the script so that the middle section
becomes:

Toggle Status Area [Show]
Enter Preview Mode [Pause]
Toggle Status Area [Hide]

so that the user can see the "Continue" button.

I did miss a script command too. There should be one more line at the
end of the above script:

Enter Browse Mode []

so that the user is looking at the DataEntyLayout in Browse Mode again.







Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.