danapip.alaska.com Posted January 28, 2009 Share Posted January 28, 2009 Anyone know how to output a separate file based on the value of a field in an input file? Link to comment Share on other sites More sharing options...
Hadrian Posted January 28, 2009 Share Posted January 28, 2009 Can you be more specific with the parameters? Link to comment Share on other sites More sharing options...
danapip.alaska.com Posted January 28, 2009 Author Share Posted January 28, 2009 Sure. Say I have a job that has a field in my input file that has a value of either "1" or "2" (just for simplicity). I would like to create a rule that composes all records with a value of "2" to a directory. It's ok if they are output as individual pdfs into the directory. Otherwise, if the field value is "1", output the records to the file specified in the "compose" tab. I hope that makes sense. Let me know if i'm speaking nonsense. Thank you in advance for any feedback. Link to comment Share on other sites More sharing options...
Hadrian Posted January 28, 2009 Share Posted January 28, 2009 You could do something as simple as this if you are not using a second external database. //Create OnNewOutputFile Callback rule vDir = "\\path for your "2" directory\\"; //Use your own field name here if(Field("Type") == "2") FusionPro.Composition.outputFileFullPathName = vDir + Field("Name")+ ".pdf"; else FusionPro.Composition.outputFileName = Field("Name") + ".pdf"; Link to comment Share on other sites More sharing options...
danapip.alaska.com Posted January 28, 2009 Author Share Posted January 28, 2009 I get an error message in the log saying "Error: In Field(), no data source defined or data could not be loaded". I'm guessing I need to specify the data source in the callback rule but I'm not sure how... Link to comment Share on other sites More sharing options...
Hadrian Posted January 28, 2009 Share Posted January 28, 2009 The path you entered is probably incomplete. See the sample below. vDir = "C:\\Documents and Settings\\Hadrian\\My Documents\\Fusion Pro Samples\\Sample1\\Directory2\\"; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.