hopkinsprinting Posted November 18, 2009 Share Posted November 18, 2009 I have a postcard job with 500 records. Each record contains contact information and a persons photo. I have a folder of 500 images and have defined said folder as a resource in FP. The spreadsheet file given to me has a column with all the file names of the images that correspond to the person the photo should go with: Column A is the file name, Column B is the persons name, Column C is the persons address, and so on... In looking at a tutorial on Printable's website, it would seem that I have to link up each image based on the persons name thus repeating the linking process 500 times. Understand that I am a novice at FusionPro. I have to believe there is an easier way. Is there? Perhaps I was looking at the wrong tutorial? Thanks, Jon Link to comment Share on other sites More sharing options...
esmith Posted November 18, 2009 Share Posted November 18, 2009 As a novice, I would suggest looking into the "Insert Picture Rule" which is a graphic rule wizard that asks for the field with your graphic name as well as the search path and a default graphic. No additional, special coding skills needed assuming the file name and field data match. Link to comment Share on other sites More sharing options...
Dan Korn Posted November 19, 2009 Share Posted November 19, 2009 If you have a field with the full graphic file names, all you need to do in a Graphic rule is this: return CreateResource(Field("MyFieldName")); Link to comment Share on other sites More sharing options...
pmhapp Posted November 19, 2009 Share Posted November 19, 2009 You could also add a warning in the report... Pic = CreateResource(Field("AprilDSM"), "graphic", false); if (Pic.exists) return Pic; else { ReportWarning("Image for " + Field("LastName") + "not found"); } But maybe that's getting a little advanced. Link to comment Share on other sites More sharing options...
Dan Korn Posted November 19, 2009 Share Posted November 19, 2009 You could also add a warning in the report... Pic = CreateResource(Field("AprilDSM"), "graphic", false); if (Pic.exists) return Pic; else { ReportWarning("Image for " + Field("LastName") + "not found"); }But maybe that's getting a little advanced. That's also unnecessary. The single-parameter call to the CreateResource function will throw an exception if the file is not found, and the message will be reported in the log (.msg) file. Also, as demonstrated by your code, you risk reporting an error about a different field than the data field you're trying to use. Link to comment Share on other sites More sharing options...
pmhapp Posted November 20, 2009 Share Posted November 20, 2009 That's also unnecessary. The single-parameter call to the CreateResource function will throw an exception if the file is not found, and the message will be reported in the log (.msg) file. True. Also, as demonstrated by your code, you risk reporting an error about a different field than the data field you're trying to use. Actually, in this case it was purposeful. Link to comment Share on other sites More sharing options...
hopkinsprinting Posted February 15, 2010 Author Share Posted February 15, 2010 Thanks to all the replies! I was able to get it to work. Wow! What a time savings!!! :-) :-) :-) Now I have a new question. Can the javascript be programmed such that if the image is missing for a given record, that it suppress the graphic rule altogether for the given record? The reason I ask is our customer wants a white line around the photo. If there is no photo available for the given record, I need the while line suppressed (the white line is added to the graphic frame via FP). Can this be done??? Thanks, Jon :-) Link to comment Share on other sites More sharing options...
rpaterick Posted February 15, 2010 Share Posted February 15, 2010 http://forums.printable.com/showthread.php?t=706&highlight=stroke Check out this thread. It might be what you are looking for further down in the discussion. Link to comment Share on other sites More sharing options...
hopkinsprinting Posted February 16, 2010 Author Share Posted February 16, 2010 I tried the referenced javascript and I get the following error when composing: Sales Rep Photo, line 8: ReferenceError:FindGraphicFrame is not defined No value associated to graphic copyhole <Sales Rep Photo> in record 43. I have named the graphic frame, "Photo" and referenced it accordingly in the javascript and the rule name is named, "Sales Rep Photo". Not sure what I am doing wrong??? Thanks, Jon Link to comment Share on other sites More sharing options...
Dan Korn Posted February 16, 2010 Share Posted February 16, 2010 I tried the referenced javascript and I get the following error when composing: Sales Rep Photo, line 8: ReferenceError:FindGraphicFrame is not defined No value associated to graphic copyhole <Sales Rep Photo> in record 43. I have named the graphic frame, "Photo" and referenced it accordingly in the javascript and the rule name is named, "Sales Rep Photo". Not sure what I am doing wrong??? What version of FusionPro are you using? The JavaScript frame properties access is available only in FusionPro version 6.0 and later. Link to comment Share on other sites More sharing options...
hopkinsprinting Posted February 16, 2010 Author Share Posted February 16, 2010 That would be why it's not working. I am using 5.x. Time to upgrade! Thanks! Jon :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.