Chapter 5. File System

5. File System

The ReportServer File system meets a variety of functions. First, it serves to file various files and resources so as to use them, for instance, as a basis for datasources (e.g. CSV files), or as resources for reports (e.g. images). In addition, a major part of ReportServer settings (e.g. the mail server configuration) can be performed with configuration files that you will find in the file system's sub-directory etc. Furthermore, so-called ReportServer scripts can be filed in the file system that cover a great number of varying cases of use. These scripts can serve as a basis for datasources (script datasources) or for reports (script reports). They can, however, also provide additional functionality, or be used to perform maintenance tasks.

The file system has a hierarchical structure, just like file systems of common operating systems. You will find the file system in the Administration module under File system. The following object types can be created in the File system tree:

Folder: Serve to structure files
File: Any file (e.g. image, text file, CSV, etc.)

Both objects share the usual attributes name and description. In addition, folders can be configured for web access. This means that objects in these folders (including subfolders) can be accessed by URL without prior authentication (i.e., permissions are not checked for accessing these objects).

After having selected a folder, in the right window above the Apply button you will find the area marked Drop files here. Here you can quickly copy files from your local file system to the ReportServer File system. Drag files, for instance, from your Windows Explorer or Mac OS Finder to the marked area. As soon as the files have been uploaded they will be dis- played in the file tree.

If you create files in the file tree by using the context menu (right click on a folder), or you select already existing files, you can enter a name and description as well as the Mime-type for the file. Additionally, you will be given the current file size as well as a download link. By means of a form, you can upload a new file to the server and update the currently stored file. Text files can directly be edited in ReportServer. In the tree, click on the text file and then select the tab Edit file (next to Properties).

5.1. Configuration Files

ReportServer configuration files are located in the etc directory, following the Unix operating system structure. Configuration files are in XML format and are marked with the file extension .cf by default. A configuration file could be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<report> 
		<id>41390</id>
	</report>
</configuration>

For further information on the individual configuration options refer to the ReportServer configuration guide.

5.2. Filing of Scripts

By default ReportServer scripts are filed in the bin directory (this location can be changed; for further information see the ReportServer configuration guide) with the file extension .rs or .groovy. ReportServer scripts are written in the language Groovy (https://groovy-lang.org/). They are a powerful tool to enhance ReportServer, to perform administrative tasks, or to generate complex reports. Please observe that a user requires the Execute right to run scripts. The explanation of ReportServer scripts in more detail would go beyond the scope of this manual. You will find a brief introduction in Chapter 13. ReportServer Scripting. For a detailed introduction to ReportServer scripts we refer to the separate scripting guide.

5.3. Accessing Resources by URL

You can access files in the ReportServer File system by URL. This facilitates the embedding of images in reports. The appurtenant URL is:

http://SERVER/APPLICATIONFOLDER/reportserver/fileServerAccess?id=XX

Here, SERVER gives the server address (e.g. demo.raas.datenwerke.net), and APPLICATIONFOLDER the installation path in your application server (e.g. Tomcat). The default setting is "reportserver". By using the property ID you can access certain files. In addition, you can use the following URL attributes:

id ID of a file
path Path leading to a file, e.g. resources/images/img.jpg
thumbnail If the file is a MimeType image/png or image/jpeg, the image is automatically scaleable. The thumbnail option activates the scaling mode for ReportServer.
twidth Gives the width of the resulting preview image.

Please observe that reading rights are required for a file by default (refer to Chapter 3. User and Permission Management) to be able to access it by URL. This indicates in particular that a user must be logged in to the system. To fully share files you may place them in a folder where a tick is set at Share folder for web access.