Hi everyone, i'm having a problem and hopefully you can help me. Until now i always used MergeFields to import information from ivy to a word-document by using e.g. the following instructions: import ch.ivyteam.ivy.addons.docfactory.TemplateMergeField; in.MergeField.add(new TemplateMergeField("FIELD1", in.xxx)); At the moment im facing the problem that i can't import .png files. It doesn't work when the data is from the type "string" because only the Path will be importet but also when the data-type is from the type "file". From my point of view it is because the mergefields only support the type "string" - is it possible to change it to the type "file" (?) If not - is there a work around? Thank you very much for your time asked 17.06.2016 at 13:39 Spfl_ |
Hi, I have tested it in IvyScript with the Ivy File type. Please get the Files path with import ch.ivyteam.ivy.addons.docfactory.TemplateMergeField; import ch.ivyteam.ivy.addons.docfactory.FileOperationMessage; import ch.ivyteam.ivy.addons.docfactory.DocumentTemplate; I get It works fine : Cheers Emmanuel answered 20.06.2016 at 15:46 Emmanuel I have tested it also with a png file (instead of a jpg). The result is the same. It works.
(20.06.2016 at 15:54)
Emmanuel
Works fine! Thank you very much.
(21.06.2016 at 09:45)
Spfl_
|
Hi, So it is quite easy (I guess) :) First in your template, your image mergefield name should start with "Image:" This allows the DocFactory Backend to intercept the mail merge operation and see it has to insert an image there. For Example: "Image:my_logo" You do then:
This should work. A new improved version of the IvyAddOns in on the way with the possibility of using java.io.File objects directly as parameters. I hope this will help you Regards Emmanuel answered 17.06.2016 at 14:05 Emmanuel Thanks so far. But it's still not working. The MergeField in the template is called «Image:FIELD1» The myLogoFile type is a java.io.File The Expression of the myLogoFile is "(new File("xxx.png")).getJavaFile()" The png. file is stored in [...]\AxonIvyDesigner6.1.0.51350_Windows_x64\files\application The pdf shows still the whole link. May you find the mistake? Thank you!
(20.06.2016 at 10:17)
Spfl_
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 17.06.2016 at 13:39
Seen: 2,022 times
Last updated: 21.06.2016 at 13:17