Jump to content

Preview Mode - Solved


This topic is 7133 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

In a message from April 20, 2001, "dykstrl" presents a script that allows you to move forward one page at a time in preview mode (e.g., to view the various pages of a report more than 1 page long). The script works fine.

My question is: is there a way to move forward AND BACKWARD, that is, one key for a page forward, another for a page backward? In other words, can I recreate the functionality of the status area in preview mode (without showing the status area)?

Thanks,

Ursula

[ April 09, 2002, 07:22 AM: Message edited by: Ursula Abresch ]

Link to comment
Share on other sites

quote:

Originally posted by Ursula Abresch:

Hello,

In a message from April 20, 2001, "dykstrl" presents a script that allows you to move forward one page at a time in preview mode (e.g., to view the various pages of a report more than 1 page long). The script works fine.

My question is: is there a way to move forward AND BACKWARD, that is, one key for a page forward, another for a page backward? In other words, can I recreate the functionality of the status area in preview mode (without showing the status area)?

Thanks,

Ursula

Hi Ursula,

here's the script that would do the job

First if you allready don't have it, create two global number fields named pageCount and i.

Now the scripts:

code:


Script "StartPreview"

Enter Prevew Mode [ ]

Go to Record/Request/Page [Last]

Set Field ["pageCount", "Status(CurrentPageNumber)"]

Set Field ["i","1"]

Go to Record/Request/Page ["i"] /number from field "i"

Perform Script [sub-scripts, "Navigator"]

Script "Navigator"

Pause/Resume Script [ ]

If ["Status(CurrentModifierKeys)=0"]

If["i+1<=pageCount"]

Set Field ["i","i+1"]

Go to Record/Request/Page ["i"] /number from field "i"

Perform Script [sub-scripts, "Navigator"]

else

Show Message ["Readty to print?"]

If ["Status(CurrentMessageChoice)=1"]

Print[ ]

Enter Browse Mode [ ]

else

Perform Script [sub-scripts, "Navigator"]

end if

end if

else

If ["Status(CurrentModifierKeys)=1"] //shift key

if [ "i-1"]

Set Field ["i","i-1"]

Go to Record/Request/Page ["i"] /number from field "i"

end if

Perform Script [sub-scripts, "Navigator"]

else

If ["Status(CurrentModifierKeys)=8"] //option key

Enter Browse Mode

end if

end if

end if

HTH

Dj

Link to comment
Share on other sites

You should also put Allow User Abort [off] at

the begining of script "Navigator" to prevent user from cancelling the script and still remain in preview mode, but do it only after you have tested the script.

Dj

Link to comment
Share on other sites

Dj, thank you. I didn't use your script quite the way you typed it up, but it got me going in the right direction.

The script (portion) I'm using is as follows:

......

Enter Preview Mode

Go to Record/Request/Page [Last]

Set Field [gPgTot, Status(CurrentPageNumber)]

Go to Record/Request/Page [First]

Show Message [ Buttons: "OK", "", ""; Data: "Press "Enter" to preview the next page, press "Enter" while holding down the "Ctrl" key to preview the previous page. To cancel previewing at any time, hold down "Shift" and press "Enter". ]

Loop

Pause/Resume Script [ Indefinitely ]

Exit Loop If [ Status (CurrentModifierKeys) = 1 ]

If [ Status (CurrentModifierKeys) = 4 ]

If [ Status (CurrentPageNumber) = 1 ]

Beep

Beep

Show Message [ Buttons: "OK", "", ""; Data: "You're on page 1 of the report ... press "Enter to go to the next page, or, hold down "Shift" and press "Enter" to end previewing this report." ]

Else

Go to Record/Request/Page [ Previous ]

End If

Else

If [ Status (CurrentPageNumber) = gPgTot ]

Beep

Beep

Show Message [ Buttons: "OK", "", ""; Data: "You're on the last page of the report ... hold "Ctrl" and press "Enter" to go to the previous page, or, hold down "Shift" and press "Enter" to end previewing this report."

Else

Go to Record/Request/Page [ Next ]

End If

End If

End Loop

Beep

Beep

Show Message [ Buttons: "No, "Yes", ""; Data: "Would you like to print this list?" ]

etc... Go on to do what you want to do next

I know the messages to the user are a bit long, but my users seem to appreciate the information.

Thanks again,

Ursula

Link to comment
Share on other sites

This topic is 7133 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.