Kim Posted October 27, 2017 Share Posted October 27, 2017 I haven't used the new multi-line feature yet. I have a database of 10,000 or so codes and I need 6 codes per press sheet layout. I can't use any of the defaults like 'changes' or 'starts with' because each code is unique. But I figure there's a way to say every 6 records? Probably by choosing 'matches'? Hope that makes sense. Basically, I need to have 6 fields on each press sheet. I have a database with one code per record right now. I've been massaging the data to have 6 tab-delimited codes per record and can continue that way, but wanted to try the new multi-line and thought this is a good case for it. Thanks, Kim Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted October 28, 2017 Share Posted October 28, 2017 I don't think the multi-line record feature is what you want. That's usually for a statement-type job, where the multiple lines of data are go into a table or some other kind of tabular format. When you say, "6 codes per press sheet," that sounds to me like an imposition job. Instead of using a body page set to the final sheet size, your FusionPro template should have page sized for just one record (or "code"). Then in FP Imposer, you can set up an imposition template for that page size, either by clicking the Load button or by setting the Finish Size. Then on the Press Sheet tab, you can set the final press sheet size, and on the Layout tab, set up a 6-up simplex imposition, with horizontal and vertical repeats of 2 and 3 (or vice-versa). Then you can save that FPI file and assign it to the FusionPro job on the Imposition tab in the Composition Settings. If all that's going on the press sheet are the "codes" you mention, then you shouldn't need any JavaScript code at all to accomplish this. If you do need some other content on the sheet besides the "codes," you can use the custom imposition sheet background feature, which is documented in the section titled "Imposition Background Sheet" in the FusionPro Rules Guide. There's also an example here: http://forums.pti.com/showpost.php?p=11530&postcount=3 Quote Link to comment Share on other sites More sharing options...
Kim Posted October 28, 2017 Author Share Posted October 28, 2017 Thanks, Dan. I should have been clearer. I understand what you mean and do jobs like that most of the time. But this is a layout that has to be a full press sheet layout because it's a special die cut with specific folds and perfs and certain sections that don't have variable and can't be repeated the way you envision. I haven't played with multi-line at all yet. I should have investigated better instead of just hoping that it could mean there was a way to stipulate that every 6 or 8 or 10 lines in a db are one record. Writing this out makes me realize I hadn't fully thought it through b/c for what I'm doing, specific fields are needed. I'll continue managing my data into the number of fields per record that I need and do better investigation into multi-line to figure out more appropriate future use. Thanks for the info. Quote Link to comment Share on other sites More sharing options...
step Posted October 30, 2017 Share Posted October 30, 2017 If you wanted to, you could make a global array containing all of your codes in an OnJobStart callback and then splice off the first 6 codes in that array and print them on every 6th record: OnJobStart allCodes = []; var fieldName = "Codes"; // Field name containing the codes. var data = new ExternalDataFileEx(PrimaryInputFile(), FusionPro.inputFileDelimiter); for (var i=1; i<=data.recordCount; i++) allCodes.push(data.GetFieldValue(i, fieldName)); Codes (text rule) if (FusionPro.inValidation) Rule("OnJobStart"); var codesPerRecord = 6; var codes = (FusionPro.Composition.inputRecordNumber % codesPerRecord) == 1 ? allCodes.splice(0, codesPerRecord) : []; return codes.filter(String).join("<br>"); Using the above code, codes for records 1-6 would be printed on the first record, codes 7-12 would be printed on the second record, et cetera. Is that what you're trying to achieve? Quote Link to comment Share on other sites More sharing options...
Kim Posted November 17, 2017 Author Share Posted November 17, 2017 Hi Ste, Realized I never replied to you and didn't want to be rude! That's some cool info you supplied and I appreciate it - I'll bank it for future when I'm sure it will come in handy. My job die cuts, perfs and folds into an accordion like book of tickets. Our layout is the entire press sheet and we place the 6 fields in specific places on that layout (can't do imposition as Dan was envisioning and as I'd normally do due to the design of the piece - parts of it are info based without any variable info). Each ticket in the book has a barcode printed on it. So during this discussion I've realized there just really have to be 6 fields in order to designate each code to a different ticket/area of the layout. We get a database of all codes in a single field and I've been reflowing that single field database into one with 6 fields. I had a fantasy when I heard multi-line that it could somehow magically parse every 6 records into 6 fields and let me put each on a different ticket since I hadn't really investigated multi-line and what it's good for. I should have done some research like I usually do, instead of just immediately posting here. Thanks again for the info though. You always have helpful code and ideas and I appreciate learning javascript solutions from you and Dan! -Kim Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.