JungleDocs | GetItemAttachments function
You can use the GetItemAttachments() function to retrieve a list of item attachments. In this tutorial, you will learn how to do this.
Retrieving attachments in reports
1. Create a table with a repeated section.
2. Select the table and insert a plain text control. Then, open the text control properties and type GetItemAttachments() in the Title and Tag fields.
3. Select a table cell and insert a rich text control inside. In the control's Title and tag field, type either of the following properties:
AttachmentFileName - displays attachment file name.
AttachmentUrl - displays attachment URL address.
Displaying image attachments
If the attachment is an image, you can make JungleDocs display it directly in the report.
1. Follow steps 1-2 from the previous instruction.
2. Insert a picture control in the table.
3. Open control properties and insert Image(AttachmentUrl) in the Title and Tag fields.
Retrieving attachments as hyperlinks
instead of displaying a file name of an attached document or image, you can make JungleDocs display a link to it.
1. See step 1 from the previous list.
2. Insert a rich text control in the table.
3. Open control properties and insert Hyperlink(AttachmentUrl; AttachmentFileName) in Title and Tag fields.
4. Add hyperlink formatting to the control (otherwise, the hyperlink will adopt a plain text format).
Below you can see a part of a document template with a repeated section configured and the GetItemAttachments() function applied already. All the different ways to retrieve attachments are illustrated, too.
And here's a result after executing a JungleDocs rule: