Jump to content

Output file based on field value


Recommended Posts

Posted
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.
Posted

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";

Posted
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...
Posted

The path you entered is probably incomplete. See the sample below.

 

vDir = "C:\\Documents and Settings\\Hadrian\\My Documents\\Fusion Pro Samples\\Sample1\\Directory2\\";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...