markdesign Posted July 27, 2001 Posted July 27, 2001 Hi, I am not good at scripting so I am looking for an example I can look at to use. The sample I am looking for is a regular invoice db, with a portal of multi items, found on a relational db with multi records. of cource it will not print correctly, so I am looking for a script that will copy the informaion of the portal and paste it in to another layout for printing. Looking for a very simple example, since I am new to scripting. Much appreciated Mark
Fuper Posted August 4, 2001 Posted August 4, 2001 When you say that "of course, it will not print properly," is it because the number of items in the portal exceeds its size, and therefore some rows don't appear in the printout? Trying to copy the contents out of any number of records and then pasting it as some kind of lump into who-knows-what receptacle, is like reinventing the wheel. I have used two solutions to this: 1. Make a separate layout for printing that is l-o-o-ong enough to hold a portal that CAN hold the number of items you anticipate. This requires several things: Your printing script must not only switch to this layout but check that the number of related records hasn't exceeded the size of even your enlarged portal. The layout must be able to break over two or more pages without text in the portal getting sliced horizontally (this takes fine tuning and may not work with multiple printers); yet the layout must also be able to shrink (with careful use of the Sliding and Printing options) in case there are only a few items. Frankly, a pain. 2. The better option: Print from the multi-item file instead of the invoice file. The top of the printed invoice is a title header in the multi-items file. As long as you have a relationship BACK to the master invoice (such as for looking up the invoice date into each line item), you can use this relationship to display text from the master invoice on this title header, using layout text if not related fields. That's okay, because when it comes time to print you don't need to edit anyway. You may not like using a print script because you want to simply press Command - P and be on your way. Once you have it in place, however, the script is just as easy to use: It gathers related line-items into a found set using Show Related, then calls a script in the multi-item file that switches to the printing layout, restores page setup and prints, and there you are. Getting subtotals to display in the master invoice record is a similar process. And NO ONE WILL KNOW that it came from the multi-item file, not the actual master invoice. Sneaky, huh?
Anatoli Posted August 4, 2001 Posted August 4, 2001 Do not even try the first way! Fuper I set you the 5 star!
markdesign Posted August 6, 2001 Author Posted August 6, 2001 I went to Borders book store, and looked at every book on filemaker, To find script example, and they just do not have such a book. Only book which tell what each function does... yeah right, thats a big help. well I had to try .... Thanks fuper, the first method was tried and the printing problems were just too much. So.. I ended up going with the second suggestion. THANKS =) It wasn't easy to figure out thats for sure. The people I made it for are having a real hard time using the new DB I have created for them because it is sooo not user friendly.. hahaha.. remind me not to quit my day job. Mark [ August 06, 2001: Message edited by: markdesign ]
LiveOak Posted August 6, 2001 Posted August 6, 2001 I think the two best FM books are Columbre and Price and Scriptology by Matt Petrowski and John Mark Osborne. Both cover more of the practical use of FM. Most of the other manual rehash the user's manual. -bd [ August 06, 2001: Message edited by: LiveOak ]
Recommended Posts
This topic is 8514 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 accountSign in
Already have an account? Sign in here.
Sign In Now