Zoomed Image

Query Sorting and Report Design

xAssets Configuration Guide
Queries and Reports

Query Sorting and Report Design

This page covers sorting query results and designing PDF reports from queries.

Sorting Queries

One or more columns can be selected to sort the query results in Ascending or Descending order by default. The user can change the sort order when the query is displayed by clicking on the column headings.

Setting the Sort Order

To set a default sort order for a query:

  1. Open the query in the Query Editor.
  2. In the Query Columns tab, select the column or columns you wish to sort by.
  3. Click Sort Ascending or Sort Descending to add the selected column to the sort order.
  4. To remove a column from the sort, select it and click Remove from Sort.

The sort order is applied in the sequence that columns are added. For example, if you sort by Category ascending and then by Asset Tag ascending, the results will be grouped by Category first, and within each category, sorted by Asset Tag.

Complex Sort Orders

The Sort Order can be edited directly in the Sort Fields input box for cases where complex orders are needed. This allows you to type SQL-style sort expressions, such as sorting by a calculated expression or using CASE statements for custom ordering.

Report Design

The Report Design tab provides options for managing the PDF report layout associated with this query. Every query can have a PDF report layout, which determines how the query results appear when exported as a PDF document.

Report Design Options

  • Reset to Default -- regenerates a standard report layout based on the current query columns. Use this after adding or removing columns to refresh the report layout.
  • Copy from Another Query -- imports the report design from a different query. This is useful when you want a consistent look across multiple reports.
  • View Report XML -- shows the raw XML report definition for advanced editing. The XML defines page layout, column widths, headers, footers, grouping, and formatting.
  • Run Report -- generates and displays the PDF report using the current report design and query data.

xAssets Report Designer

For detailed report design work, use the standalone xAssets Report Designer application. This is a Windows desktop application that connects to your xAssets instance via web services and works with both hosted and on-premise installations. The Report Designer provides a visual drag-and-drop interface for creating professional report layouts with headers, footers, grouping, totals, and custom formatting.

Tip: After adding or removing columns from a query, use Reset to Default on the Report Design tab to regenerate the report layout. Otherwise the PDF report may show stale columns or be missing new ones.