Overview
Version
Report Server Version | Functional Change |
---|---|
11.0 | / |
Function Description
In data entry reports, you can use formulas to obtain the name, type, and size of a file uploaded by a file widget.
Function | Notes |
---|---|
filename(file) | Returns the file name. |
filetype(file) | Returns the file type. |
filesize(file) | Returns the file size. |
The type of the returned value by each formula is an array, regardless of how many files are uploaded.

1. You can only use these functions for files uploaded by file widgets. Files stored in the database are not supported.
2. These functions do not support simulation calculation. For details about simulation calculation, see section "Operator Syntax."
Example
filename(file)
You can use this function to obtain the file name. The parameter file represents the cell number where the file widget is located.
Create a template, add a file widget to cell B2, and enter =filename(B2) in cell C2. Select Data Entry Preview, click the file widget, and upload a PNG file. The following figure shows the effect.
filetype(file)
You can use this function to obtain the file type. The parameter file represents the cell number where the file widget is located.
Enter =filetype(B2) in cell D2 of the template created in the former step. Select Data Entry Preview, click the file widget, and upload a PNG file. The following figure shows the effect.
filesize(file)
You can use this function to obtain the file size with the unit of KB. The parameter file represents the cell number where the file widget is located.
Enter =filesize(B2) in cell E2 of the template created in the former step. Select Data Entry Preview, click the file widget, and upload a PNG file. The following figure shows the effect.
Template Download
For details, you can download the template Getting the Name, Type, and Size of an Uploaded File.cpt.