In the event that you have an original image that is too large to insert into the description of an item, there is the option to add the image as an attachment to the item. Once it is uploaded, it is possible to include the original image in PDF output. This article describes how to configure a report or document so that attachments are included in the PDF output.
Example Data
The section item in this document structure has an image attachment.
Example Configuration
Use the <ForEachAttachment> and <Image> tags in the configuration as shown below.
<Report> <ForEach select="/IRRS"> <ApplyItemTemplates/> </ForEach> <ItemTemplate type="SSSE"> <Section title="#{Name}"> <Description/> <ForEachAttachment> <Image/> </ForEachAttachment> <ForEach select="/ISSE"> <ApplyItemTemplates/> </ForEach> </Section> </ItemTemplate> </Report>
Example Result
This will put the attached image at the end of the item description in the document.
Things to Consider
Using a Specified Item for Single Attachment
Example Data
The section item in this document structure has an image attachment.
Example Configuration
Use the <ForEachAttachment> and <Image> tags in the configuration as shown below.
<Report> <ForEach select="/IRRS"> <ApplyItemTemplates/> </ForEach> <ItemTemplate type="SSSE"> <Section title="#{Name}"> <Description/> <ForEachAttachment> <Image/> </ForEachAttachment> <ForEach select="/ATCH1"> <ApplyItemTemplates/> </ForEach> </Section> </ItemTemplate> </Report>
Example Result
This will put the attached image as a sub-section after the Section 1 item.
Note: Depending on quantity and size, including large images as attachments will affect total report generation time. |
What's Next?
Find out how to include information about the attachment file in a report.