tallboy755 Posted January 31, 2005 Posted January 31, 2005 hello all ... i work with a photography company and i am looking to create camera cards ... i am currently using filemaker as my primary database program ... The "Camera card" is an 8.5x11 sheet that will display 9 records on it ... this is relativly simple... but here is the catch ... i need the records to be sorted very oddly before printing ... see the attached three images to better explaing what i need. Lets just say that my database has 27 records for sanity's sake. on the cards i need the records to be printed "stacked" what i mean is that on page 1 the first record should print is the first of the nine slots. (see attached) however ... the second record needs to be in the first place on page two. ,, likewise for the third record. needs to be in the first place on page three. This may be all two confusing ... but i am totally lost .... the only way i see this possible it to create a sort field ... then fill it with a calcualted result. that calculation being something like "number of records" divided by 9 - that will get me the total number of pages that will be used in the printout ... then fill with a serial number starting at 1 and increasing by the total number of pages .... maybe thats not the way to do it ... please let me know if you have any ideas ----------------------------------------------------------- ----------------------------------------------------------- ----------------------------------------------------------- ----------------------------------------------------------- ----------------------------------------------------------- -----------------------------------------------------------
BobWeaver Posted January 31, 2005 Posted January 31, 2005 You will need a field to serialize your records. Let's call it "SN". And then another one for a page count. Let's call it "Pages" (which contains the value of current record count divided by 9). Assume that SN contains the photo numbers. You can make a sort field "SortOrder" with this calculation: 9*Mod(sn-1;Pages)+Int((sn-1)/Pages)+1 Then sort on the SortOrder field. This should work when the number of records is an exact multiple of 9, but I don't know how you want to handle less than exact multiples. <<Edit: I had the formula backwards. Fixed it.>>
-Queue- Posted January 31, 2005 Posted January 31, 2005 I hope Bob doesn't aim that cannon at me for this. You can replace Int((SN - 1)/9) with Div( SN - 1; 9 ), and there is a missing ending parenthesis.
tallboy755 Posted January 31, 2005 Author Posted January 31, 2005 i need 3 things then ... How can i get "(which contains the value of current record count divided by 9)" how do i get the SN field to contain the Current record number how can i automaticly add (how ever many) records needed to make it exact multiples of nine?
BobWeaver Posted January 31, 2005 Posted January 31, 2005 Hi Queue, Actually, I realized after I posted, that the formula I gave would give the picture sequence, 1, 4, 7, 10, 13, 16... etc., which is not the same as the sort order which is in fact 1, 10, 19, 2, 11, 20... etc. I edited the formula in the previous post before I saw your reply. Still being new to FM7, I wasn't familiar with the DIV function.
BobWeaver Posted January 31, 2005 Posted January 31, 2005 Tallboy, you can do this with a script: **Add records to make exact multiple of 9 Loop Exit Loop If [ not Mod ( Get ( FoundCount ) ; 9 ) ] New Record/Request End Loop ** Count pages Set Field [ Pages; Get ( FoundCount )/9 ] **Set the SN field Equal to the record number Replace Field Contents [ sn; Replace with calculation: Get ( RecordNumber ) ] [ Update Entry Options ]
Recommended Posts
This topic is 7304 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