Embedding Images dynamically
The awisto OfficeIntegration makes it possible for you to embed images from your CRM-System into your documents. To do this you can either provide the URL of the image or the image itself, which will be interpreted as an Base64-Encoded data stream, to the XML-Readout. It is also necessary to add a picture content control
to the template.
Data Source
The LinkedFetchXMLDataSet of the product image will load for each order item separately. The example below presumes that there is only one saved image for each order item. In addition, the images need to either be png- or jpeg-format.
<i18n:LinkedFetchXmlDataSet ItemName="Produktbild" FromAttribute="salesorderdetailid" MultipleItems="false">
<i18n:FetchXml>
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name=" salesorderdetail">
<filter type="and">
<condition attribute=" salesorderdetailid" operator="eq" value="@parentid" />
</filter>
<link-entity name="product" from="productid" to="productid" alias="af">
<link-entity name="productsalesliterature" from="productid" to="productid" visible="false" intersect="true">
<link-entity name="salesliterature" from="salesliteratureid" to="salesliteratureid" alias="ag">
<link-entity name="salesliteratureitem" from="salesliteratureid" to="salesliteratureid" alias="ah">
<attribute name="filename" />
<attribute name="documentbody" />
<filter type="or">
<condition attribute="mimetype" operator="like" value="%png" />
<condition attribute="mimetype" operator="like" value="%jpeg" />
</filter>
</link-entity>
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>
</i18n:FetchXml>
</i18n:LinkedFetchXmlDataSet>
You can also load the entity image of an record by following extension of the DefaultDataSet
, e.g. Contact
<i18n:FetchXmlDataSet>
<i18n:FetchXml>
<fetch aggregate="false">
<entity name="contact">
<attribute name='entityimage' />
<filter type="and">
<condition attribute="contactid" operator="eq" value="@objectid" />
</filter>
</entity>
</fetch>
</i18n:FetchXml>
</i18n:FetchXmlDataSet>
Or load the entity image within in List of LinkedDataSet
e.g. Contacts
<i18n:DefaultDataSet>
<i18n:LinkedDataSet Entity="contact" FromAttribute="accountid" ToAttribute="parentcustomerid" ItemName="Contact" MultipleItems="true">
<i18n:Columns>
<i18n:Column>fullname</i18n:Column>
<i18n:Column>firstname</i18n:Column>
<i18n:Column>lastname</i18n:Column>
<i18n:Column>salutation</i18n:Column>
<i18n:Column>address1_line1</i18n:Column>
<i18n:Column>address1_postalcode</i18n:Column>
<i18n:Column>address1_city</i18n:Column>
<i18n:Column>address1_country</i18n:Column>
<i18n:Column>entityimage</i18n:Column>
<i18n:Column>parentcustomerid</i18n:Column>
</i18n:Columns>
</i18n:LinkedDataSet>
</i18n:DefaultDataSet>