Data Designs                
Services Products Ordering Contact Us
               

Here is the demo database that shows how the
"Preview in Browse Mode with live buttons" works.


This sample has full (open) access to all users, so it can be picked apart,
reverse-engineered, or pirated by FileMaker developers.
 
Download the Mac file, stuffed and binhexed (170k).
Download the Wintel file, zipped.

If you didn't catch the post from Dana Alan Perry online, here is a reprint: Several recent posts have discussed working in FMP Preview Mode, or how to control preview pages via script. There is a little-known new feature of FMP 3.0, which could solve your scripted print preview problems.
 
If you know about this, great. If you don't, try it. You might find it useful.
 
In Preview Mode, the Copy command will make a complete rasterization of the current page of the preview, copied to the clipboard. This is more than a PICT of the image. It contains more information, including postscript and truetype font metrics. If the page includes an eps, it is retained. Anyway, the copied "image" can be pasted anywhere within the FileMaker Pro 3.0 or 4.0 world (layouts or container fields), and it will print sharply. So the trick is to paste the result to a container field.
 
Define a global container field called PreviewPage. Draw it on a layout to be 8 inches wide (assuming a .25 inch margin on left & right). Graphic format the container to crop, and to place the image up and to the left. Field format it with a vertical scroll bar, if you wish; or draw it 10.5 inches tall for larger monitors (or use the application scroll bars to get around).
 
Make this layout have a footer that is, say, 50 pixels tall. The footer will be your button bar (or make a header button bar).
 
Define a global(number) called PageNum. Put this field (use MergeField) on the button bar so user knows what page is being viewed.
 
[...You can add another global to store the MaxPageNum at beginning of preview script (Go to last page, SetField etc), so the button bar will show "Page 1 of 5", for example...]
 
Put these buttons on the button bar:
NEXT PG PREV PG PAGE UP PAGE DN PRINT DONE
 
Now, back on your "original" layout put a Print/Preview button.
 
This effect is the most striking when previewing complex sub-summarized columnar reports, or anything employing sliding objects.
 
The following scripts can/should be prefaced with
- --Toggle Status Bar [hide, lock]
- --Allow User Abort [Off]
 
PREVIEW button:
- -Perf Find (optional)
- -Sort (optional)
- -Go to Layout [Complex report] (or ??)
- -Page setup
- -Enter Preview Mode
- -Set Field [PageNum, Status(CurrentPageNumber) ]
- -Copy []
- -Enter Browse Mode
- -Go to Layout [the one with the Big Global Container]
- -Paste [select, Big Global Container field]
- -Exit record (or for old time's sake, Go to Field [] )
 
NEXT PG button:
- -Go to Layout [Complex report] (or ??)
- -Enter Preview Mode
- -Go to Record/Request/Page [Given by "PageNum"]
- -Go to Record/Request/Page [next]
- -Set Field [PageNum, Status(CurrentPageNumber) ]
- -Copy []
- -Enter Browse Mode
- -Go to Layout [the one with the Big Global Container]
- -Paste [select, Big Global Container field]
- -Exit record
 
PREV PG button:
Go to Layout (Complex report or ??)
- -Enter Preview Mode
- -Go to Record/Request/Page [Given by "PageNum"]
- -Go to Record/Request/Page [previous]
- -Set Field [PageNum, Status(CurrentPageNumber) ]
- -Copy []
- -Enter Browse Mode
- -Go to Layout (the one with the Big Global Container)
- -Paste [select, Big Global Container field]
- -Exit record
 
PAGE UP button:
- -Page up (this just scrolls the window to show more of the container)
 
PAGE DN button:
- -Page down (this just scrolls the window to show more of the container)
 
PRINT button:
This can do several different things. You can go to the complex sub-summ report layout and have the print job run from there (dialogged or not). Or you can print the contents of the container field, by putting it alone on another layout or even using the button bar layout (get creative here: specify non-printing buttons or whatever...). The container field is holding the "smart" rasterization of page X of the report, and it will print with no "jaggies". It is up to you.
 
Other options include formatting the container to reduce (or enlarge) the preview to fit within a smaller box, like a zoomed out (or in) preview. Or Go to Record/Request/Page [a specified page number].
 
So now you can view Print Previews in Browse Mode, with live buttons. Any questions?
 
Dana Alan Perry (FSA Member since 1994)

 


Tips
Preview in Browse Mode with Live Buttons
 
 
 
 
 
Home | Services | Products | Support/Downloads | Ordering | Contact Us ©2004 Data Designs