Kicker3 Posted April 16, 2005 Posted April 16, 2005 I have a layout that I'm using container fields in a portal to store pictures (actually a reference to a picture) but sometimes I have 3 or 4 and maby as many as 10 pages, my problem is that when I only have a few pages like 2 or 3, when I print it wants to print all 10 pages ( as that is how big the table is) I would like to have a script or some way of printing only pages with filled container fields. And not the empty pages. Right now I have to physically look and count how many pages to print. Which is ok until I forget to look and just hit print and I get all 10 pages. I dont need 6 or 7 pages of empty container fields. Anyone know how I can fix this?
dkemme Posted April 16, 2005 Posted April 16, 2005 How is your database structured, do you have one container per record, one repeating container per record or multiple containers per record?
Kicker3 Posted April 16, 2005 Author Posted April 16, 2005 Its a portal so it has unlimited containers.
dkemme Posted April 16, 2005 Posted April 16, 2005 I would create a layout based upon the table that has the containers with one container per page. Then create a script that goes like this: GoToLayout(above layout) SetErrorCapture(On) -- this will avoid a no find error being seen by the user EnterFindMode, no pause SetField ( ID, get ( scriptparameter ) ) -- where ID is some unique identifier of the records in this table Perform find if ( get ( foundcount > 0 ) -- just a test to make sure something is found print records end if Now create a button on the layout that displays the picture records in a portal, call the above script passing the parameter of the ID that identifes the records in that portal. This will print all the records. You could also create a similar script/button that can be placed in the portal and print only one record
Recommended Posts
This topic is 7508 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