[fusionpro] Re: Can Callbacks be Nested?
Raul... and more importantly Richard, In my zeal to resolve this topic, I discovered tonight, my statement of being the original poster of Splitting Records based on a Field in the data was incorrect. My apologies to Richard of PLM Group! Ryan Blackmer -- On Jun 22, 2007, at 11:23 AM, Ryan Blackmer wrote: Thank Raul, Unfortunately... I was the original poster of Splitting Records based on a Field in the data Body. Your suggestion does work and I currently use it or manually split the database depending on the number of total records. I simply want to automate the whole process since there are upwards of 30-50 groupings. Composing the same database 30-50 times would drive anyone crazy. I understand Dan's original suggested process but am having a difficult time with the last part. I somehow need to distill the data into a temp. file and insert empty records up to the maximum records per chunk or group. FusionPro would then skid or not compose the empty records. I understand the ExternalDataFileEx part. I already have a summery sheet based on the input file. So I guess the question should really be... How do I (or what is the javascript code to) insert the empty records into the temp file? Ryan +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Calling all FP Web Users! Do you have a question or lots of knowledge to share about FusionPro Web? If so, join our Printable Web to Print Users' Forum today! Send email to [EMAIL PROTECTED] to find out how! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] -- View FusionPro Knowledge Base, FusionPro Samples at www.printable.com/vdp/desktop.htm -- You are currently subscribed to fusionpro as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- -- Note: All e-mail sent to or from this address will be received or otherwise recorded by the e-mail recipients of this forum. It is subject to archival, monitoring or review by, and/or disclosure to someone other than the recipient. Our privacy policy is posted on www.printplanet.com --
[fusionpro] Re: Can Callbacks be Nested?
Ryan, I believe that you might need to use the following original post from Dan Korn and a later re-post from David Sweet . === Date: Fri, 17 Nov 2006 13:31:01 -0600 Author: Dan Korn [EMAIL PROTECTED] Subject: RE: Splitting Records based on a Field in the data Body: Is it possible to split a Composed job based on a field in the data and have the resulting PDF's named using that field. Sorry for the delay in responding. I had to do some investigation on this one. The answer is that, yes, it's possible. There are several steps involved: First, check the Output to multiple files box on the Output tab of the Composition Settings dialog and set the number of records to 1. Then, create the OnNewOutputFile callback rule and, in it, set the FusionPro.Composition.outputFileName (or FusionPro.Composition.outputFileFullPathName) property, like so: FusionPro.Composition.outputFileName = Field(AccountHolder) + .pdf; Change the field name as appropriate for your data. If you compose thusly, you will see that you get one output file for each account holder. However, you'll only get one record's worth of data in each output file. So we need to compile data from multiple records to create a single output file for all the records pertaining to each account holder. This is where you can use an ExternalDataFileEx object to look ahead for data from other records. You can see an example of this under How to return multiple records in the same output file in the FusionPro Rules Editor Reference Guide. If you really want to have separate output pages within each account-holder specific output file for each input record, then you will need to do something a little bit different than in the example. My advice is to create a routine in OnJobStart to read in the original data file and create a new one with record chunks of specific sizes, which you can then use as your input file for the composition. In other words, you'll create, say, a hundred records for each account-holder, but only the number of actual records from your original input file will contain data, and the rest will be empty. You can then put some logic into OnRecordStart to set FusionPro.Composition.composeThisRecord = false for the extra empty records in each output file chunk. Set the number of records per output file in the Composition Settings to the same number of records you're creating for each account-holder, including the empty records. We are looking into adding the ability to start a new output file at any given time through JavaScript, without having to rework your input file, in a future version. But you'll have to use a strategy like the one outlined above for now. Dan === The second part of this response deals more with your request. Take a look at your data, and figure out the largest output group that you would have. Then adjust the ExternalDataFileEx file Dan refers to earlier in this posting, and allow for an even amount more than that record size. Take a look at the example in the KnowledgeBase for repeat a Given Record a Number of Times to give you a good example of how to create an External data file. In your OnRecordStart during composition, you would have something like.. if (Field(field_name) == ) FusionPro.Composition.composeThisRecord = false; This will skip any of your blank records. In your OnNewOutputFile you would set the name of that output file.. FusionPro.Composition.outputFileName = Field(field_name) + .pdf; hth David Sweet Variable Pre-Press Consolidated Graphics Group, Inc. === What used for mine was one OnNewOutput File rule and an OnRecordStart rule. //OnNewOutput File //You can use a CurrentRecordNumber function or get a specific field value //CurRec = CurrentRecordNumber(); Data = new ExternalDataFileEx(CAData.csv, ,); Name = Data.GetFieldValue(2, 0); FusionPro.Composition.outputFileName = Group + Name + .pdf; //OnRecordStart // say you only want the group GroupA on your database to compose and skip the other records if (Field(GroupName) != GroupA) FusionPro.Composition.composeThisRecord = false; I may be going about this the wrong way but it seemed to work for me. Raul === +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Calling all FP Web Users! Do you have a question or lots of knowledge to share about FusionPro Web? If so, join our Printable Web to Print Users' Forum today! Send email to [EMAIL PROTECTED] to find out how! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] -- View FusionPro Knowledge Base, FusionPro Samples at www.printable.com/vdp/desktop.htm -- You are currently subscribed to fusionpro as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- -- Note: All e-mail sent to or from this address will be received or otherwise recorded by the e-mail recipients of this forum. It is subject to archival, monitoring
[fusionpro] Re: Can Callbacks be Nested?
Thank Raul, Unfortunately... I was the original poster of Splitting Records based on a Field in the data Body. Your suggestion does work and I currently use it or manually split the database depending on the number of total records. I simply want to automate the whole process since there are upwards of 30-50 groupings. Composing the same database 30-50 times would drive anyone crazy. I understand Dan's original suggested process but am having a difficult time with the last part. I somehow need to distill the data into a temp. file and insert empty records up to the maximum records per chunk or group. FusionPro would then skid or not compose the empty records. I understand the ExternalDataFileEx part. I already have a summery sheet based on the input file. So I guess the question should really be... How do I (or what is the javascript code to) insert the empty records into the temp file? Ryan -- On Jun 22, 2007, at 10:37 AM, [EMAIL PROTECTED] wrote: What used for mine was one OnNewOutput File rule and an OnRecordStart rule. //OnNewOutput File //You can use a CurrentRecordNumber function or get a specific field value //CurRec = CurrentRecordNumber(); Data = new ExternalDataFileEx(CAData.csv, ,); Name = Data.GetFieldValue(2, 0); FusionPro.Composition.outputFileName = Group + Name + .pdf; //OnRecordStart // say you only want the group GroupA on your database to compose and skip the other records if (Field(GroupName) != GroupA) FusionPro.Composition.composeThisRecord = false; I may be going about this the wrong way but it seemed to work for me. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Calling all FP Web Users! Do you have a question or lots of knowledge to share about FusionPro Web? If so, join our Printable Web to Print Users' Forum today! Send email to [EMAIL PROTECTED] to find out how! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] -- View FusionPro Knowledge Base, FusionPro Samples at www.printable.com/vdp/desktop.htm -- You are currently subscribed to fusionpro as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- -- Note: All e-mail sent to or from this address will be received or otherwise recorded by the e-mail recipients of this forum. It is subject to archival, monitoring or review by, and/or disclosure to someone other than the recipient. Our privacy policy is posted on www.printplanet.com --
[fusionpro] Re: Can Callbacks be Nested?
David, Thank you! The second thought sounds very promising... we'll give it a try. As I mentioned, I already have an ExternalDataFileEx creating a summery sheet with all the relevant data for our xerox/bindery/ mailing departments. And I've already created a rule to recognize the chuck/group change from current record to previous record. It would just be so darn simple to be able to nest the OnNewOutputFile callback into the OnRecordStart (or OnRecordEnd) callback. Either way... I'll post our success... or failure. Ryan --- On Jun 22, 2007, at 12:58 PM, David Sweet wrote: Ryan, Just sort of thinking out loud here, but if you look at the file on the KnowledgeBase for the multiple Business Card, it has a method in its script to write records to a new file that you create in OnJobStart. If you augment this script to: 1) not be of a variable length but a specified chunk-length that you define; 2) as you are adding records, test for the change in your file category field; 3) when you change from one file-category to the next, continue the adding loop with blank records 4) repeat the loop for the next set of records until your entire input file is finished. On second thought, this may need a nested loop. Using the ExternalDataFileEx you can search through and determine the number of changes for your field category. The outer-loop would be this number of file-categories your script counted, while the inner-loop would contain your chunk-defined loop to append records and blanks. --- David A. Sweet Web Designer/Graphic Designer HKM Direct Market Communications A DirectConnectGroup Company +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Calling all FP Web Users! Do you have a question or lots of knowledge to share about FusionPro Web? If so, join our Printable Web to Print Users' Forum today! Send email to [EMAIL PROTECTED] to find out how! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] -- View FusionPro Knowledge Base, FusionPro Samples at www.printable.com/vdp/desktop.htm -- You are currently subscribed to fusionpro as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- -- Note: All e-mail sent to or from this address will be received or otherwise recorded by the e-mail recipients of this forum. It is subject to archival, monitoring or review by, and/or disclosure to someone other than the recipient. Our privacy policy is posted on www.printplanet.com --