Hadrian Posted June 25, 2012 Share Posted June 25, 2012 I have a database that has specific quantities to output per store that I want placed in one PDF per store. Store Sticker Qty NY 3000 CA 2500 NV 3000 TX 4000 OR 2900 FLA 1500 I know i have to use repeat record count FusionPro.Composition.repeatRecordCount = Field("Sticker Qty"); and OnNewOutputfile FusionPro.Composition.outputFileName = Field("Store") + ".pdf"; How do i get FP to output say all of the 3000 for the NY store to one pdf file and the 2500 for the CA store to another. I know that i can compose to multiple files but that asks for specific quantities per record. I am assuming i need to have FP know the start and stop per record and move to the next record. My question is what callback do i use when using repeatrecord? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 25, 2012 Share Posted June 25, 2012 This kind of scenario is exactly why we added support for dynamic, or arbitrary, chunking (and stacking, if you're using imposition) in FusionPro 8. All you need to do is make sure that the "Output to multiple files" box on the Output tab of the composition settings dialog is UNchecked, then add this to the OnRecordStart rule: if (FusionPro.Composition.repeatRecordNumber == 1) FusionPro.Composition.OpenNewOutputFile();Also, you can specify the file name in the call to OpenNewOutputFile, like so: if (FusionPro.Composition.repeatRecordNumber == 1) FusionPro.Composition.OpenNewOutputFile(Field("Store") + "." + FusionPro.Composition.outputFormatExtension);Then you can eliminate the OnNewOutputFile rule as well. Quote Link to comment Share on other sites More sharing options...
Hadrian Posted June 25, 2012 Author Share Posted June 25, 2012 I think i forgot to mention that i intended to use this in order to create a sequenced set of tickets example NY 3000 number padded pieces in one file "0001", "0002", etc. I am only getting one record or padded record per file i was using this to number the pieces return FormatNumber("0000", 1 + FusionPro.Composition.repeatRecordNumber - 1); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 25, 2012 Share Posted June 25, 2012 I think i forgot to mention that i intended to use this in order to create a sequenced set of tickets example NY 3000 number padded pieces in one file "0001", "0002", etc. I am only getting one record or padded record per file i was using this to number the pieces return FormatNumber("0000", 1 + FusionPro.Composition.repeatRecordNumber - 1); Okay, that should still work fine in conjunction with the arbitrary chunking logic I posted. Quote Link to comment Share on other sites More sharing options...
Hadrian Posted June 25, 2012 Author Share Posted June 25, 2012 thought so too but i am only getting the first record or padded number ("0001") per file. i am using a full version of FP8 and made sure the records were no duplicates. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 25, 2012 Share Posted June 25, 2012 thought so too but i am only getting the first record or padded number ("0001") per file. i am using a full version of FP8 and made sure the records were no duplicates. Then you must be doing something differently from the rule logic that's been quoted in this thread. It's working fine for me. Take a look at the attached job.sample-repeat.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 25, 2012 Share Posted June 25, 2012 Also, did you make sure to uncheck the "Output to multiple files" box on the Output tab of the Composition Settings dialog? Quote Link to comment Share on other sites More sharing options...
Hadrian Posted June 25, 2012 Author Share Posted June 25, 2012 thanks Dan. Did not have the repeatRecordcount in the OnRecordStart. I was wondering where that came into play. I now understand the logic of combining both objects. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 25, 2012 Share Posted June 25, 2012 thanks Dan. Did not have the repeatRecordcount in the OnRecordStart. I was wondering where that came into play. I now understand the logic of combining both objects. Right, you still need to tell it how many times to repeat. That's why I said to add that other code to what you already had in OnRecordStart. Quote Link to comment Share on other sites More sharing options...
Eric Patrick Posted July 3, 2012 Share Posted July 3, 2012 Hi Dan, I'm using the info in this post and it works great except when I use an impo. Is something specific I need to do to get multiple PDF files when using an impo? I can't attached the project I'm working on so I'll email it to you. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 3, 2012 Share Posted July 3, 2012 (edited) I'm using the info in this post and it works great except when I use an impo. Is something specific I need to do to get multiple PDF files when using an impo? It depends on how the imposition is set up. If you're using stacked imposition, then you also need to add this to OnJobStart: FusionPro.Composition.chunksBreakStacks = true; Otherwise, the chunk breaks are deferred until the next stack break by default. I can't attached the project I'm working on so I'll email it to you. I can't look at specific jobs offline (outside the context of this forum) unless they go through proper Support channels. Edited July 3, 2012 by Dan Korn Quote Link to comment Share on other sites More sharing options...
Eric Patrick Posted July 3, 2012 Share Posted July 3, 2012 That did the trick! Thanks, this will cut production time down considerably! Quote Link to comment Share on other sites More sharing options...
ehigginbotham Posted August 17, 2012 Share Posted August 17, 2012 A little different spin on it. I have a file that has about 26000 records in it that go onto three different letters. The data has a field that identifies which letter that it is supposed to apply to. There are about 79 different record types, which are identified by that field. Is there a way in FP to export the files by that field? Our fulfillment department needs them seperated by that field. We have sorted them into order in our mailing software. It just seems very redundent to have to export 79 files out of the mailing software, and then link to 79 different files, and compile them all seperately. any ideas? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 17, 2012 Share Posted August 17, 2012 A little different spin on it. I have a file that has about 26000 records in it that go onto three different letters. The data has a field that identifies which letter that it is supposed to apply to. There are about 79 different record types, which are identified by that field. Is there a way in FP to export the files by that field? Our fulfillment department needs them seperated by that field. We have sorted them into order in our mailing software. It just seems very redundent to have to export 79 files out of the mailing software, and then link to 79 different files, and compile them all seperately. any ideas? Sure, just do this in OnRecordStart: if (FieldChanged("YourFieldName")) FusionPro.Composition.OpenNewOutputFile(); Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 19, 2012 Share Posted September 19, 2012 It depends on how the imposition is set up. If you're using stacked imposition, then you also need to add this to OnJobStart: FusionPro.Composition.chunksBreakStacks = true; Using this method with the sample job with FP 8.1.2, I am having trouble getting the first record to output with the name applied in the rule. Instead it always reverts to whatever name is specified in the Composition window. Records 2 and up work great. Is there any way to get the first record to follow the naming convention from the rule? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 19, 2012 Share Posted September 19, 2012 Using this method with the sample job with FP 8.1.2, I am having trouble getting the first record to output with the name applied in the rule. Instead it always reverts to whatever name is specified in the Composition window. Records 2 and up work great. Is there any way to get the first record to follow the naming convention from the rule? Instead of using the OnNewOutputFile rule, you can set the output file name in the call to FusionPro.Composition.OpenNewOutputFile(), as I explained in the second post in the thread: http://forums.pti.com/showpost.php?p=10559&postcount=2 Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 19, 2012 Share Posted September 19, 2012 Instead of using the OnNewOutputFile rule, you can set the output file name in the call to FusionPro.Composition.OpenNewOutputFile() That's the way I was setting it up. The only change to the sample-repeat file was the addition of chunksBreakStacks = true and outputting with an imposition. Attached is the revised file with the imposition. Also is a screenshot of the 6 files being output. The one named repeat-Output.pdf is what I was trying to output with the name of the first record, in this case NY.sample-repeat-imposed.zip Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 24, 2012 Share Posted September 24, 2012 I'm wondering if anyone got a chance to take a look at this. I'm still trying to get it to work and it would be nice to know if this is a bug or if I'm just missing something. I've really looked it over closely and tried a few different ways of doing it with the same results, the first imposed set does not seem to take the name from the script. Non-imposed works fine though. Quote Link to comment Share on other sites More sharing options...
Eric Patrick Posted September 24, 2012 Share Posted September 24, 2012 I have the same problem. The only workaround I have come up with is to duplicate the first record in my data. This will will create the first record (the Dup) as the generic name "repeat-output.pdf" and correctly name all records 2 thru ?? It isn't great but it is a work around until we get further info from Dan. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 24, 2012 Share Posted September 24, 2012 Thanks for the tip, I hadn't thought of that. I think it should work pretty well for what I'm using it for too. 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.