spongebob Posted October 12, 2006 Posted October 12, 2006 Hello oh mighty ones. I have a layout with a portal. The portal shows 2 occurences with 2 fields each. How can I make sure that ALL occurrences of the portal are printed? IE if theres 5 I want all 5 on the printout... Can it be done oh powerful ones? Spongebob
John Mark Osborne Posted October 12, 2006 Posted October 12, 2006 Usually, when you print, you go to a layout displaying the records instead of printing from a portal. You can use the Go to Related Record script step to locate the related records and display them on a print layout. If you want to also print information from the parent table, just use related fields on the layout containing the portal records.
spongebob Posted October 13, 2006 Author Posted October 13, 2006 Hmmmmmm... interesting approach. However the "truth" actually is that I have a layout like this 10 fields then a portal showing 2 of 8 existent rows with scrolly wheel 10 fields then a portal showing 2 of 4 existent rows with scrolly wheel 10 fields then a portal showing 2 of 6 existent rows with scrolly wheel 10 fields and of those layouts I have about 20 layouts with varying numbers of protals on them. If I do as you suggest that would only work for showing one portal right? I, however would like a printout looking like this 10 fields then showing all 8 existent rows 10 fields then showing all 4 existent rows 10 fields then showing all 6 existent rows 10 fields preferably on one or two pages ie continous and not a new page for every portal... doable with the method you suggest? hmmmmmm... Spongebob
ThatOneGuy Posted October 13, 2006 Posted October 13, 2006 (edited) Hi spongebob: Since we don't have any way (at least not yet) to make portals expand or contract as needed, the method described by John Mark is the optimal standard for printing related child records. With the help of a "Go To Related Records" script step, we switch to a layout defined for the related table and print that resulting set of child records. Works great. [color:green]Edit: Portals CAN contract using printing and sliding options -- See below If I do as you [John Mark] suggest that would only work for showing one portal right? Assuming each of your portals relate to different tables, then, yes, it would work for just one portal. You would need separate routines for each portal, or more precisely, for each relationship. However, if the portals (relationships) you described are instead different views of the same related table ... i.e., filtered relationships of child records ... then you have a "fighting chance." But nothing in your posts indicates that's the case. How can I make sure that ALL occurrences of the portal are printed? In order to print all portal rows, you'll need to set the number of portal rows displayed sufficient for all circumstances. We do that in the Portal Setup. Since portals cannot be expanded or contracted, though, you'll probably end up with lots of blank rows printed for some records. Whether you can achieve this "on one or two pages" depends on how you design your layout. ... I have about 20 layouts with varying numbers of protals on them. Then you have a lot of work ahead. If you have not already built some layouts dedicated for printing, now is probably a good time to do so. If you have the chops (your forum profile shows an "Advanced" skill level), you could have an assortment of layouts dedicated to printing. You could then test for counts of related records, and your scripts could call the layout which best fits the number of related child records. This, too, is a lot of work. If you're really, really dead-set on your approach ... There is one other way, but it is a great deal of work. In Portal Setup, we can declare not only the "number of rows" to be displayed, but also the initial row on which the portal begins. If you ... • Format a portal for a relationship, showing just 1 row • Set the "Sliding/Printing" options for that portal and its fields to (a) Sliding up based on all above and ( Also reduce the size of the enclosing part • Duplicate that portal and its fields and change its initial row to the next number (like, "2") • "Rinse and Repeat" for each additional portal row, until you have a sufficient number of rows, and for each and every relationship, incrementing the initial row each time ... Then you can come closest to achieving what I believe you have in mind. Along the way, you can check your progress in Preview Mode. You'll have to give great care to the design of your layout. You'll probably want to disable the scroll bar for each of those portals, and you may want to turn "off" the lines of the portals through the "pen" tool. But my tests (FM8.0v3) satisfied me it is possible. I have no inkling if this can all be done within the boundaries of "one or two pages." Again, it depends on your needs and your design. And I'm probably mistaken, but at the moment I cannot imagine a task more tedious. Edited October 17, 2006 by Guest Edited at request of user
Oldsneekers Posted October 15, 2006 Posted October 15, 2006 Here is a solution to printing the data from several portals onto one page. Create a text field for each of the portals you wish to get data from. (You can also put all the data from several portals into one field.) Put these fields at the desired locations on the page remembering to expand them to contain the maximum amount of data the field might hold and format to size with "sliding and printing" options. Place a portal (size and rows don't matter) on the layout and format with scroll bar (they should be outside the page margins). For each portal you will need a script that goes a portal row field, starts at the first row, copies (use setfield) the data to the text field then goes to the next row, exits after last. (LOOP) You can place any separator you want between each portal row entry in the text field (paragraph mark...). You can use an "if" statement to omit any lines that don't have the data or the kind of data you want in the text field. Don't use a "go to field" step that goes outside the portal row while you are in the portal as you will loose you place in line (so to speak). Repeat for each portal you want to copy. I hope this was helpful and if you need more details, I'll try to dig up my file, so let me know. Greg.
spongebob Posted October 16, 2006 Author Posted October 16, 2006 (edited) Thank you all for that valuable input; I think thatoneguys input is the way Ill try it first and yes Btw; I already made layouts for printing. All my portals are portals to different tables. Not views to the same table. Having read your answers twice; Im unsure hoe the "initial row portal solution" you suggest differs from a single portal showing 100 rows having sliding/printing switched on. Only that the page break will be nicer? Thanks for all your input dudes; as said; looks like I have alot of work ahead....oh well...here we go...and by the way...the rating as advanced just goes to show that thinking one is advanced really doesnt make one advanced eh? I think ill advance it to novice... :) Edited October 16, 2006 by Guest
ThatOneGuy Posted October 16, 2006 Posted October 16, 2006 Hey Spongebob! Im unsure hoe the "initial row portal solution" you suggest differs from a single portal showing 100 rows having sliding/printing switched on. Only that the page break will be nicer? You're right! In my haste, I failed to set the Sliding/Printing options on the standard portal. When those are applied, the standard portal does indeed "contract" to fit the number of related records. Thank you for prompting me to look again. And I think you're spot on about the "nicer page breaks." With it being the only apparent benefit, the value of that whole suggestion is further diminished. (While drafting this response, I wanted to correct my previous post. Alas, the "Edit" option is not displayed ... I guess that window has closed. If a Moderator is listening, I would appreciate the opportunity to rectify that post and point out my mistake.) ...the rating as advanced just goes to show that thinking one is advanced really doesnt make one advanced eh? Well, this just keeps gettin' better. As a mea culpa, I've emailed the local animal shelter to see if I can volunteer some database development time.
spongebob Posted October 17, 2006 Author Posted October 17, 2006 dont be too hard on yourself please...as for me you helped me ALOT :)
Genx Posted October 17, 2006 Posted October 17, 2006 Out of curiosity, what exactly is a "Mea Culpa"?
Inky Phil Posted October 17, 2006 Posted October 17, 2006 If my memory serves me well 'Mea Culpa' is Latin for 'I'm to blame' or 'my fault' Phil
Genx Posted October 17, 2006 Posted October 17, 2006 Lol, ThatOneGuy, stop being so harsh on your self man, correction is part of the learning process. I called a guy a chick the other week! I'm still cracking up about that sigh. But yeh, all good, correction is good -- the more you get corrected the more you learn. God know's i've been corrected more times than anyone else on this forum, but i'm getting there -- and once i figure out that they're right and drop my not so bright arguments, i will learn something and take that something away -- never to perform that something that happens to be a bad something again - get my drift? Me Neither : As for YOU phil, thanks for the info :)
Recommended Posts
This topic is 6613 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