Jump to content

Weird preview mode


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

Recommended Posts

I’m having problems with preview mode and I haven’t found anything on the forum to help me solve this. When on an active record, I want to print the report layout for that record. When I run the print script (below) the preview shows the 1st record and not the active record, but when it prints, it prints the correct active record perfectly. This will be confusing to the user when they see the 1st record in preview mode and they want to print the active record. Help….please! lpm

# Purpose: Print individual skill record

Go to Related Record [ From table: “MATH_SKILLS”; Using layout: “MSK_Report_IndivSkill” (MATH_SKILLS) ]

[ Show only related records; New window ]

#PROBLEM: Next step, Preview Mode, should display the intended/active record, but instead it displays the 1st record. (see Curiosity comment below)

Enter Preview Mode

Adjust Window

[ Maximize ]

Pause/Resume Script [ Indefinitely ]

Show Custom Dialog [ Title: "Print Individual Skill Report?"; Message: "Do you want to print this skill report?"; Buttons: “Yes”, “No” ]

If [ Get(LastMessageChoice) = 1 ]

#CURIOSITY: When "Current record" is selected in Print dialog, the intended/active record is, in fact, printed perfectly -- not the 1st record which displayed (above) in preview mode

Print [ Current record; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]

[ Restore ]

If [ Get(LastError) = 1 ]

Show Custom Dialog [ Title: "Printing Cancelled"; Message: "Printing has been cancelled!"; Buttons:

“OK” ]

End If

End If

Close Window [ Name: "MSK Indiv Report"; Current file ]

Enter Browse Mode

Go to Layout [ original layout ]

Adjust Window

[ Maximize ]

Link to comment
Share on other sites

If you have remembered to abide to general development rules of thumb would you have a record ID in the records in the related tabel as well. Here would an extra GTRR over a selfjoin single out the portal rows record, and make it the only candidate for the preview.


Link to comment
Share on other sites

This is all happening within a single table (the only one in the file right now). I just want to be able to preview the same record that already prints out correctly. I can tell the users to disregard the preview and go ahead and print, but this would be a bit confusing although their print result will be correct. It is just preview mode that's weird. Any thoughts?

Edited by Guest
Link to comment
Share on other sites

I've never noticed this before, but this does happen.

When you enter Preview mode, the Preview defaults to the first page, but the "Current Record" for print options remains the record you were last on.

The simplest thing is to add:

Show All Records

Omit Record

Show Omitted Records

to isolate that one record for Preview mode.

If you need to maintain the found set for some reason, that can be done with a GTRR to an extra table occurence, as Soren may be implying.

Link to comment
Share on other sites

This topic is 6089 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
  • Create New...

Important Information

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