randy.willeyefi.com Posted February 17, 2011 Share Posted February 17, 2011 I am using FusionPro Desktop 7.1. I have created the following OnNewOutputfile Callback rule: var new_file_name = 'BusinessCard_' + Field("Name") + '.pdf'; FusionPro.Composition.outputFileName = new_file_name; return 0; Every time I compose the template, I receive the following error and the output file is not named properly: OnNewOutputFile, line 1: Error: In Field(), no data source defined or data could not be loaded If I remove the field reference from the rule, I do not get the error. I only get the error with the field referenced in the rule. What am I doing wrong? Link to comment Share on other sites More sharing options...
Alex Marshall Posted February 17, 2011 Share Posted February 17, 2011 In this script I sent you, you need to modify the field name to match your data file. Also, did you link the flat file to the template PDF? You need to do this first. Link to comment Share on other sites More sharing options...
randy.willeyefi.com Posted February 17, 2011 Author Share Posted February 17, 2011 The field name does match the data file. When creating the rule, I placed the field in my rule by using the Building Block Insert option, so I know the field name is correct. My data file is linked to the PDF. Link to comment Share on other sites More sharing options...
Dan Korn Posted February 17, 2011 Share Posted February 17, 2011 That callback has no effect unless you check the "Output to multiple files" box on the Output tab of the Composition Settings dialog. The error message is a reporting bug, but has no effect on the output. See: http://forums.printable.com/showthread.php?t=1857 Link to comment Share on other sites More sharing options...
randy.willeyefi.com Posted February 17, 2011 Author Share Posted February 17, 2011 It doesn't appear to just be a reporting error since my output file is not being named properly. The output file is being named "Data-Output.pdf" instead of what the rule is telling it to name the file. I'm not outputting multiple records, I'm only outputting one. The "Output to multiple files" option is greyed out. Link to comment Share on other sites More sharing options...
Dan Korn Posted February 17, 2011 Share Posted February 17, 2011 It doesn't appear to just be a reporting error since my output file is not being named properly. No, it is a reporting error, as mentioned in that other case I linked to. Trust me, I know this code. The output file is being named "Data-Output.pdf" instead of what the rule is telling it to name the file. I'm not outputting multiple records, I'm only outputting one. Like I said, unless you have that "Output to multiple files" box checked, then the OnNewOutputFile callback has absolutely no effect on your output. This is by design. There is no "new output file" being created in this case; it's just whatever name you specify in the Output tab. The "Output to multiple files" option is greyed out. If you're using FusionPro Designer, you can only output one record, by definition, so the options to output multiple files, and therefore to rename your multiple output files, are disabled. You need FusionPro Desktop, Direct, or Server to be able to output multiple files. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.