• Metric Reports for Web
  • Dashboard for Web

    Show / Hide Table of Contents
    • Report Designer
      • First Look at the Report Designer
      • Add New Reports
      • Open Reports
      • Save Reports
      • Introduction to Banded Reports
      • Bind to Data
        • Bind a Report to a Database
        • Specify Query Parameters
        • Bind a Report to JSON Data
        • Bind a Report to an Object Data Source
        • Data Binding Modes
        • Bind Report Controls to Data (Expression Bindings)
        • Bind Report Controls to Data (Data Bindings)
        • Use Embedded Fields (Mail Merge)
        • Validate Report Data Bindings
      • Create Popular Reports
        • Create a Letter
        • Create a Table Report
        • Create an Invoice Manually
        • Create a Master-Detail Report (Use Detail Report Bands)
        • Create a Master-Detail Report (Use Subreports)
        • Create a Report with PDF Content
        • Create a Hierarchical Report
        • Create a Vertical Report
        • Create Labels and Badges
        • Create a Multi-Column Report
        • Create a Report with Cross-Band Content and Populated Empty Space
        • Create an Interactive E-Form
        • Create a Cross-Tab Report
      • Configure Design Settings
        • Change a Report's Measurement Units
        • Change a Report's Page Settings
        • Enable the Right-To-Left Layout
      • Use Report Elements
        • Manipulate Report Elements
          • Add Controls to a Report
          • Select Report Elements and Access Their Settings
          • Move and Resize Report Elements
          • Apply Styles to Report Elements
          • Copy Report Controls
          • Arrange Report Controls
          • Add Report Controls to Containers
          • Validate the Report Layout
        • Use Basic Report Controls
          • Label
          • Character Comb
          • Rich Text
          • Check Box
          • Picture Box
          • Subreport
          • Panel
          • Page Break
          • Table of Contents
          • Page Info
        • Use Tables
          • Table Overview
          • Bind Table Cells to Data
          • Manage Table Structure
          • Manipulate Table Elements
          • Hide Table Cells
        • Use Bar Codes
          • Add Bar Codes to a Report
          • Bar Code Recognition Specifics
          • Codabar
          • Code 11 (USD-8)
          • Code 128
          • Code 39 (USD-3)
          • Code 39 Extended
          • Code 93
          • Code 93 Extended
          • EAN 13
          • EAN 8
          • ECC200 - Data Matrix
          • GS1 - DataBar
          • GS1- Data Matrix
          • GS1-128 - EAN-128 (UCC)
          • Industrial 2 of 5
          • Intelligent Mail
          • Intelligent Mail Package
          • Interleaved 2 of 5
          • Matrix 2 of 5
          • MSI - Plessey
          • PDF417
          • PostNet
          • QR Code
          • UPC Shipping Container Symbol (ITF-14)
          • UPC Supplemental 2
          • UPC Supplemental 5
          • UPC-A
          • UPC-E0
          • UPC-E1
        • Use Charts and Pivot Grids
          • Use Charts in Reports
          • Add a Chart (Set Up Series Manually)
          • Add a Chart (Use a Series Template)
          • Use Charts to Visualize Grouped Data
          • Link a Chart and a Pivot Grid
        • Use Gauges and Sparklines
          • Add Gauges to a Report
          • Add Sparklines to a Report
        • Draw Lines and Shapes
          • Draw Lines
          • Draw Shapes
          • Draw Cross-Band Lines and Boxes
      • Shape Report Data
        • Filter Data
          • Filter Data at the Report Level
          • Filter Data at the Data Source Level
          • Limit the Number of Records to Display
        • Group and Sort Data
          • Sort Data
          • Group Data
          • Sort Data by a Custom Field
          • Group Data by a Custom Field
          • Sort Groups by a Summary Function's Result
        • Shape Data (Expression Bindings)
          • Format Data
          • Conditionally Change a Control's Appearance
          • Conditionally Change a Label's Text
          • Conditionally Change a Band's Visibility
          • Conditionally Filter Report Data
          • Conditionally Suppress Controls
          • Limit the Number of Records per Page
          • Calculate a Summary
          • Calculate an Advanced Summary
          • Display Row Numbers in a Report, Group or Page
          • Count the Number of Records in a Report or Group
          • Count the Number of Groups in a Report
        • Shape Data (Data Bindings)
          • Format Data
          • Conditionally Change a Control's Appearance
          • Conditionally Change a Label's Text
          • Conditionally Change a Band's Visibility
          • Conditionally Filter Report Data
          • Conditionally Suppress Controls
          • Limit the Number of Records per Page
          • Calculate a Summary
          • Calculate a Custom Summary
          • Display Row Numbers in a Report, Group or Page
          • Count the Number of Records in a Report or Group
          • Count the Number of Groups in a Report
        • Use Calculated Fields
          • Calculated Fields Overview
          • Calculate an Aggregate Function
          • Calculate a Weighted Average Function
        • Use Report Parameters
          • Create a Report Parameter
          • Report Parameters with Predefined Static Values
          • Report Parameters with Predefined Dynamic Values
          • Multi-Value Report Parameters
          • Cascading Report Parameters
          • Date Range Report Parameters
      • Lay out Dynamic Report Content
        • Maintain the Band Location on a Page
        • Keep Content Together
        • Maintain the Size and Content of Data-Bound Controls
        • Anchor Controls
        • Suppress Controls
      • Customize Appearance
        • Appearance Properties
        • Report Visual Styles
      • Add Navigation
        • Add Page Numbers
        • Add Cross-References and Hyperlinks
        • Add Bookmarks and a Document Map
        • Create a Table of Contents
      • Provide Interactivity
        • Create Drill-Down Reports
        • Sort a Report in Print Preview
        • Edit Content in Print Preview
      • Add Extra Information
        • Add Watermarks to a Report
        • Display the Current Date and Time in a Report
        • Display the User Name in a Report
      • Merge Reports
        • Add a Report to the End/Beginning
        • Use Data-Driven Page Sequence
      • Use Expressions
        • Expression Syntax
      • Localize Reports
      • Preview, Print and Export Reports
      • Report Designer Tools
        • Report Wizard
          • Empty Report
          • Table and Vertical Report
            • Select Data Source
            • Specify Data Source Settings (Database)
            • Specify Data Source Settings (JSON)
            • Specify Data Source Settings (Object)
            • Define Report Layout
            • Specify Page Settings
          • Label Report
        • Data Source Wizard
          • Specify Data Source Settings (Database)
          • Specify Data Source Settings (JSON)
          • Specify Data Source Settings (Object)
        • Design Surface
        • Main Menu
        • Main Toolbar
        • Toolbox
        • Query Builder
        • Chart Designer
        • Expression Editor
        • Filter Editor
        • Format String Editor
        • Master-Detail Relation Editor
        • Script Editor
        • Localization Editor
        • UI Panels
          • Properties Panel
          • Expressions Panel
          • Field List
          • Report Explorer
    • Metric Report Manager
      • First look at the report manager
      • End user management
      • Open a report using the Report Manager
      • Add new report to the Report Manager

    Query Builder

    The Query Builder is a visual queries editor. You can invoke it from the Data Source Wizard.

    Select Tables

    Drag and drop a specific table or view onto the Query Builder design surface to include it into a query result set.

    The Query Builder provides a toolbar with the following commands:

    Icon Description
    web-designer-query-builder-button-delete Removes the selected table or view from the query.
    web-designer-query-builder-button-undo Reverses the most recent action.
    web-designer-query-builder-button-redo Performs the previously undone action.

    Enable check boxes for the table columns you want to include into the query result set.

    Use the dedicated search box to find a specific table or view.

    Join Tables

    The Query Builder allows you to join tables and/or views. Use drag and drop to connect corresponding columns (key fields). The connected columns should have identical data types.

    Click the data relation to display the Relation Properties section. Properties in this section define the join type (Inner or Left Outer) and applied logical operator.

    A left outer join returns all the values from an inner join along with all values in the "left" table that do not match to the "right" table and includes rows with NULL (empty) values in the key field.

    If you select the left outer join, the relationship line displays an arrow which points at the "right" table of the join clause.

    The executed query returns a "flat" table which joins different tables within a single query. The specified join options define which data records compose the query result set.

    Note

    We recommend you to use hierarchical data sources because the reporting engine generates master-detail reports faster than similar-looking reports which obtains data from "flat" data sources.

    Filter Data

    Expand the Query Properties section to display the query options.

    The query provides the following options:

    • Name

      Specifies a custom query name (alias).

    • Filter

      Runs the Filter Editor where you can specify filter conditions for the resulting data. Filter criteria may contain query parameters.

    • Group Filter

      Runs the Filter Editor where you can specify filter conditions for grouped and aggregated data. This option is enabled only for grouped data.

    • Select All (*)

      Specifies whether to include all columns from the selected tables and/or views to the query result set, regardless of their individual settings.

      The default value is No.

    • Select Top

      Specifies the number of first records to include to the query result set. The default value is 0 and indicates that the query result set contains all records that meet all other filter conditions.

    • Offset

      Specifies the number of records to skip before the report engine retrieves data. This option is available only for sorted data.

    • Select distinct

      Specifies whether to include only distinct values to the result set.

      The default value is No.

    Shape Data

    Select a table or view and click a data column to display the data column options.

    The Column Properties section contains the following options:

    • Name

      Indicates the column name which the Query Builder obtains from the database.

    • Type

      Indicates the column's data type.

      The Query Builder provides information about the maximum string length for string columns.

    • Alias

      Specifies a custom column name (alias).

      Include a column into a query to enable this option.

    • Output

      Specifies whether to include the column into the query result set.

    • Sort Type

      Specifies whether to preserve the original data records' order within the column, or sort them (in an ascending or descending order).

    • Sort Order

      Apply sorting to the data column's records to enable this option.

      It defines the sorting priority for multiple columns (the less this number is, the higher the priority).

      For example, set the sort order to 1 for the column A and set it to 2 for the column B. The Query Builder first sorts the query by column A and then by the column B.

      All columns' sort order automatically updates when you change this setting for one column. It allows you to avoid conflict of priorities.

    • Group By

      Specifies whether to group the query result set by this column.

      Note

      You should apply grouping and/or aggregation to each selected column.

    • Aggregate

      Specifies whether to aggregate the column's data records.

      You can use the following aggregate functions: Count, Max, Min, Avg, Sum, CountDistinct, AvgDistinct, SumDistinct.

      The Query Builder discards individual data records from the query result set and keep only the aggregate function result when you apply any of these functions.

      Note

      Use aggregation/grouping either for all selected columns or for none of them. The Query Builder applies grouping to all selected columns automatically if you apply the aggregation to one column. The Query Builder resets grouping against other columns when you remove all aggregation functions.

    Use Query Parameters

    Use the Parameters section to add, remove and edit query parameters.

    Each query parameter provides the following properties:

    • Name

      Specifies the query parameter's name.

    • Type

      Specifies the parameter value's data type.

      Set this property to Expression to generate parameter values dynamically.

    • Result Type

      Specifies the data type of the expression's result value.

      This property is enabled if the query parameter's type is Expression.

    • Value

      Determines the query parameter's actual value.

      You can specify a static actual value according to the selected value's data type.

      Alternatively, construct an expression to generate actual parameter values dynamically. Click this property's ellipsis button to invoke the Expression Editor and create an expression. This ellipsis button is enabled if you set the query parameter's type to Expression.

    Preview Results

    Click the Preview Results button to test a query on the actual data's limited subset at any time.

    The opened Data Preview screen displays the first 100 data records of the query result set.

    web-designer-query-builder-data-preview

    Back to top Copyright © 2020 Metric d.o.o. www.mymetric.net, metric@zg.t-com.hr