4.5. UI Customization

In this section we cover the possibilities of customizing the user interface. ReportServer provides the following customization options:

  • Specifying the default language,
  • Customizing error messages,
  • Customize the theme,
  • customize PDF preview,
  • customize the report documentation,
  • add tabs based on context

Further customization options are available with the use of ReportServer scripts. More information on ReportServer scripts can be found in the Administration Guide.

4.5.1. Specifying the available languages

Any visible text in ReportServer can, in principle, be displayed in any language. The languages available on log-in can be defined in the configuration file /fileserver/etc/main/localization.cf.

	<default>de</default>

The "default" property specifies which language to use as default language.

	<locales>en,fr,de</locales>

The "locales" property specifies a comma-separated list of available languages. If the property is not specified, all supported languages are available for selection.

Remark. The user's selection is stored in a cookie. Thus, the change of the default locale will not override any locale settings done by a user previously.
Remark. A large part of the translations have been generated in a semi-automatic way and are thus far from perfect. If you are a native speaker in one of the languages and would like to contribute please contact us at info@infofabrik.de.
4.5.2. Customization of error messages

Errors can occur due to various reasons.

Typical errors are:

  • an error occurs on the database during report execution, because:
    • a table does not exist,
    • a column does not exist,
    • there is a syntax error in the underlying SQL,
    • the JDBC driver was not installed
    • etc.
  • the connection pool does not have any free connections

An exception is thrown whenever an error occurs in ReportServer. The exception is composed of: a title, error message, and the stack trace.

In /fileserver/etc/main/templates.cf you can customize the error message that is displayed on errors that occur during the export of reports.

When customizing the error message you should give clear instructions as to what the affected employee should do in this case. Usually you would specify the contact address of an administrator or help desk. When customizing, the following substitutions are available: ${headline}, ${msg} and ${stacktrace}.

4.5.3. Customization of error messages

In ReportServer Enterprise Edition it is possible to customize the theme via the /fileserver/ui/theme.cf config file. Further information on this can be found in the administration guide.

4.5.4. Preview for PDF reports

In the configuration file /fileserver/etc/ui/previews.cf you can specify how to render PDF previews. The options are ${native} (to use the native browser capabilities), ${jsviewer} (to use a javascript library) or ${image} to not render a PDF at all, but to only render the first page as an image. Also note that users can overwrite the settings within their profiles.

4.5.5. Adding contextual tabs

Using the configuration file /fileserver/etc/ui/urlview.cf you can define context aware tabs to be displayed in the TeamSpace or in the administration module (e.g., report management, user management, etc.). This allows you to, for example, display the documentation report directly whenever a user selects a report in the TeamSpace.

The configuration of extra tabs is split into two parts:

	<?xml version="1.0" encoding="UTF-8"?>
	<configuration>
		<adminviews>
		
		</adminviews>
		<objectinfo>
		
		</objectinfo>
	</configuration>

Tabs to be displayed in the administration module go into the adminviews tags and tabs for the TeamSpace are put within the objectinfo tags, respectively. The default configuration does not add any additional tabs for the admin interface, but adds several tabs to the TeamSpace:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <adminviews>
    </adminviews>
   <objectinfo>
     <view>
       <types>net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskReportReferenceDto</types>
       <name>${msgs['net.datenwerke.rs.core.service.urlview.locale.UrlViewMessages']['info']}</name>
       <url>rs:reportdoc://${reportId}/${id}</url>
     </view>   
     <view>
      <types>net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskReportReferenceDto</types>
      <name>${msgs['net.datenwerke.rs.core.service.urlview.locale.UrlViewMessages']['history']}</name>
      <url>rs:revisions://${reportId}</url>
     </view>
     <view>
      <types>net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskReportReferenceDto</types>
      <name>${msgs['net.datenwerke.rs.core.service.urlview.locale.UrlViewMessages']['preview']}</name>
      <url>rs:reportpreview://${reportId}</url>
     </view>
   </objectinfo>
</configuration>

Each <view> tag adds a new tab. The <types> tag allows to define for which types of objects the tab is displayed and <name> provides a name (in the above example, the name is localized, but you could also simply write <name>SomeName</name>. Finally, the <url> tag takes a URL that is to be displayed. In the above example we have three custom ReportServer URLs that access custom functionality, the first accesses a documentation report, the second a revisions report and the last one a preview of the report. Via the replacement ${reportId} the id of the object is added to the URL.

In the following we go through the process of adding new tabs step by step.

Adding a new Tab

To add a new tab, you define a <view> tag. For adding a tab to the TeamSpace whenever a report is selected add the following <view> tag within the <objectinfo> section.

	<view>
		<types>
			net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskReportReferenceDto
		</types>
		<name>Some Additional Information</name>
		<url>
			reportserver/reportexport?key=someKey&amp;format=html&amp;p_reportId=${reportId}
		</url>
	</view>

The above will execute the report with key "someKey" and pass the given report id as parameter. The following types are available in TeamSpaces.

All Objects in a TeamSpace:

net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.AbstractTsDiskNodeDto

All folders in a TeamSpace:

net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskFolderDto

All reports and variants in a TeamSpace:

net.datenwerke.rs.tsreportarea.client.tsreportarea.dto.TsDiskReportReferenceDto

All exported reports which were, for example, created by the scheduler:

net.datenwerke.rs.scheduleasfile.client.scheduleasfile.dto.ExecutedReportFileReferenceDto

The name field defines the tab's name. The url is the address that is displayed. This also allows you to access external addresses, that are then displayed within the tab.

For the report documentation you need to use the special ReportServer URL:

rs:reportdoc://${reportId}/${id}

As you can see there are two placeholders in the above url: ${reportId} and . The following replacements are available

id the object's id
type the object's type
username the current user's username

Note that TeamSpaces do not only contain report references. Thus, the replacement ${id} will contain the id of the reference rather than the id of the referenced report. For this, there is the special replacement called ${reportId} which is only available for report references.

Similarly, to the report documentation in the TeamSpace you can display additional information on any selected object in the administration module. In the administration module you can add tabs to objects in the report management, user management, dadget management, datasource management and fileserver modules. These are configured within the <adminviews> tag.

The following tables describe which types can be used. Note that the type must be used together with the corresponding prefix.

4.5.6. Objects in Report Management

Prefix net.datenwerke.rs.core.client.reportmanager.dto.reports.

Type Description
AbstractReportManagerNodeDto All objects in the report management tree
ReportDto reports
ReportFolderDto folders
4.5.7. Objects in User Management

Prefix net.datenwerke.security.client.usermanager.dto.

Type Description
AbstractUserManagerNodeDto All objects in the user management tree
UserDto users
GroupDto groups
OrganisationalUnitDto organisational units (folders)
4.5.8. Objects in the file server

Prefix net.datenwerke.rs.fileserver.client.fileserver.dto.

Type Description
AbstractFileServerNodeDto All objects in the file server
FileServerFolderDto folders
FileServerFileDto files
4.5.9. Objects in Datasource Management

Prefix net.datenwerke.rs.core.client.datasourcemanager.dto.

Type Description
AbstractDatasourceManagerNodeDto all objects in datasource management
DatasourceFolderDto folders
DatasourceDefinitionDto datasources
4.5.10. Objects in Dadget Management

Prefix net.datenwerke.rs.dashboard.client.dashboard.dto.

Type Description
AbstractDashboardManagerNodeDto All objects in the dashboard tree
DashboardNodeDto dashboards
DashboardFolderDto folders

The following example would display a tab User Information which displays the website at Url http://www.mycompany.com/employee.

	<adminviews>
		<view>
			<types>net.datenwerke.security.client.usermanager.dto.UserDto</types>
			<name>User Information</name>
			<url>http://www.mycompany.com/employee=${id}</url>
		</view>
	</adminviews>