mclisa81 Posted December 13, 2013 Posted December 13, 2013 I have a rule that names my output files that I need some help with so it works correctly. I'm uploading my files for clarity if needed. FusionPro.Composition.outputFileName = "ITEMNAME_" + CurrentRecordNumber() + "_" + "codes_" + Field("Codes") + "_thru_" + Field("codeend") + "." + FusionPro.Composition.outputFormatExtension; 1) The CurrentRecordNumber needs to be changed to number the output files sequentially 1, 2, 3, etc. 2) I want to eliminate the Field "codeend" (which I put in manually each time) and use only the Field "Codes" to pull in the ending code # of each batch. Assuming for this example, I'm composing 23 records in batches of 10. My rule names the output... ITEMNAME_1_codes_X43c_thru_My1x.pdf ITEMNAME_11_codes_eX92_thru_P9Mt.pdf ITEMNAME_21_codes_w6MZ_thru_Z7e1.pdf What I'd like the files to be named, using only the Field "Codes" are... ITEMNAME_1_codes_X43c_thru_My1x.pdf ITEMNAME_2_codes_eX92_thru_P9Mt.pdf ITEMNAME_3_codes_w6MZ_thru_Z7e1.pdf Thanks in advance. LisaOutput_test_template.pdffilename.txt Quote
step Posted December 13, 2013 Posted December 13, 2013 Would this work for you? var input = new ExternalDataFileEx(FusionPro.Composition.inputFileName,"\t"); var codeEnd = input.GetFieldValue(FusionPro.Composition.inputRecordNumber+9,"Codes"); var fileName = "ITEMNAME_" + FusionPro.Composition.currentOutputFileNumber + "_codes_" + Field("Codes") + "_thru_" + codeEnd + ".pdf"; FusionPro.Composition.outputFileName = fileName; Quote
mclisa81 Posted December 13, 2013 Author Posted December 13, 2013 Hi, Thanks for the quick reply! It's almost there. The only thing is that the last .pdf in the composition may not have 10 records, so it leaves the endcode blank on filename as below... ITEMNAME_3_codes_w6MZ_thru_.pdf Any idea for fixing that? I'm going to play around with the rule you sent me and see if I can come up with anything. Thanks for the help Lisa Quote
step Posted December 13, 2013 Posted December 13, 2013 Oh, I see. Probably the easiest thing to do is to modify the 'codeEnd' variable to look like this: var codeEnd = input.GetFieldValue(FusionPro.Composition.inputRecordNumber+9,"Codes") || input.GetFieldValue(input.recordCount,"Codes"); Quote
mclisa81 Posted December 13, 2013 Author Posted December 13, 2013 EXCELLENT! Thanks for all your help and Happy Holidays! Quote
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.