File export
Report manager > File export
Use the format "File export" when running a report to download all documents and pictures you have uploaded in File type fields.
Prerequisite
A prerequisite to run a File export is to have a Report template where you include the necessary Relation and File fields. For example, let’s say that you want to download photos that technicians have uploaded while doing tasks for certain projects, and your data model looks like this: Project ← Task ← Photo
In that case, in Report wizard you will select Project as Main table, then choose Reverse relation, add Task(→Project), and select Task in the Table hierarchy to add Photo(→Task) as well. Go to the next window, and select Photo(→Task) in the Table hierarchy to finally add the File field. You might want to add other fields to set filters to shorten the resulting records, but be aware that only the Files are exported as output, and your main Table and Relations will work as directory path in the resulting zipped report, for example:
-
(first level folders - A folder per Project record) Fiber
-
(second level folders - A folder per Task record) 10001
-
(third level folders - A folder per Photo record) 90001
-
(actual file) IMG_20250515_2345.jpg
-
-
-
You may customize the path, the folders' and files' names as described in our next topic.
Customize you File export report with an XLS template
-
Write an .xsl template including code to rearrange the directory path, and/or the names of folders and files.
-
Upload the .xls template in the Report macro files form.
-
In Report manager, select the Report template you created to export files, and click on the Edit icon. In the Records to include window, set the previously uploaded .xls template as Macro/transform, and go through the next windows to finish the report.
-
Run the report, and download the zipped file.
Examples of customization
The following examples of .xls templates are based on the data model shown in the Prerequisite topic above, i.e., Project ← Task ← Photo.
Example 1: Remove all folder levels and list all files with customized name
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<report>
<xsl:for-each select="//file[@filekey]">
<file filekey="{@filekey}" id="{@id}" size="{@size}">
<xsl:value-of select="concat('Project', ../objname[1], '_', 'Task', ../objname[2], '_', .)"/>
</file>
</xsl:for-each>
</report>
</xsl:template>
</xsl:stylesheet>
This would result in a list of files, stored directly on the zip, named like this:
ProjectFiber_Task10001_IMG_20250515_143055.jpg ProjectFiber_Task10001_IMG_20250517_143056.jpg ProjectFiber_Task10002_IMG_20250611_143057.jpg
Example 2: Keep first level folders and list files with fixed name
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<report>
<xsl:for-each select="//file[@filekey]">
<file filekey="{@filekey}" id="{@id}" size="{@size}">
<xsl:value-of select="../objname"/>/Image.png
</file>
</xsl:for-each>
</report>
</xsl:template>
</xsl:stylesheet>
This would result in a list of files with the same name and format, grouped by Project folder, named like this:
-
Fiber
-
Image.png
-
Image (1).png
-
Image (2).png
-
-
Wireless
-
Image.png
-
Image (1).png
-
Example 3: Create a directory name with a customized file name
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8"/>
<!-- template match for file field -->
<xsl:template match="file">
<xsl:copy>
<!-- include all attributes -->
<xsl:apply-templates select="@*" />
<!-- change filename -->
<!-- slash creates a directory named whatever is on the left -->
<!-- resulting file path: Top-folder-name/Sub-folder-name/File-name -->
<!-- resulting file name: Top-folder-name_Sub-folder-name_Filename -->
<xsl:value-of select="concat('Top-folder-name', '/', 'Sub-folder-name', '/', 'Top-folder-name', '_', 'Sub-folder-name', '_', .)" />
</xsl:copy>
</xsl:template>
<!-- identity template -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The string preceding the "/" will become the name of the directory. The result will be:
-
Top-folder-name
-
Sub-folder-name
-
Top-folder-name_Sub-folder-name_IMG_20250515_143055.jpg
-
Top-folder-name_Sub-folder-name_IMG_20250517_143056.jpg
-
Top-folder-name_Sub-folder-name_IMG_20250611_143057.jpg
-
-