Editing Reports

Edit a Report in StaffMap:

  1. Open the Sidebar Menu and select the report you would like to edit.
  2. Select the Edit button from the top toolbar.

3. In the resulting Report Properties panel, edit the Name, Icon, SQL or Styles.

4. Select the Save button to confirm your changes.

Report SQL

The SQL field will accept any standard SQL queries, including sorting and joins. Use the following notation to select database elements:

[_TableName].[FieldName]

For example, the following query will display employees who have been assigned to desks.

SELECT [_Employees].[LastName], [_Employees].[FirstName], [_Desks].[deskname], [_Floors].[FloorName] FROM [_Employees] INNER JOIN [_Desks] ON [_Employees].[Desk_id]=[_Desks].[desk_id]INNER JOIN [_Floors] ON [_Employees].[Floor_Id]=[_Floors].[floor_id]

You can learn more about SQL queries at w3schools.com.

Note - If ‘ORDER BY’ is not found in the report’s SQL query, the report will be sorted by the first column.

Report Styles

The Styles field can be used to apply standard CSS to elements of the report. Table columns are named incrementally, e.g:

.col1

.col2

.col3 etc.

Report Variables

The variables {username} and {empid} variables can be used in Report queries.