logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to sort the data in the report FastReport .NET
  • Building libgdiplus library from source

    October 2, 2020

    When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating

    read more
  • Creating ITF-14 barcodes in .NET applications

    February 25, 2021

    ITF-14 (Interleaved Two of Five) is a two-band numeric code, otherwise known as a

    read more
  • Copying report bands to another with all the contents

    March 31, 2021

    Sometimes there is a need to use parts of one report in another. In simple

    read more
  • FastCube - High-Speed OLAP Cube Engine and Pivot Grid

    February 29, 2020

    It is difficult to imagine data analysis without OLAP (On-Line Analytical Processing) technology. Although there

    read more
  • Reports and PDF documents in Blazor

    April 5, 2021

    Microsoft has recently launched a web platform called Blazor. This framework allows creating an interactive

    read more

How to sort the data in the report FastReport .NET

April 22, 2020

Sorting data is one of the most important data processing tools. We can say, it is the basis of the analysis. Analysing chaotic output data is almost impossible. Therefore, sorting provides all the tools that work with data. This also applies to reporting tools. After all, the data source may provide the report data is not sorted, or sorted, but not in the required field, not in the order.

The documentation for FastReport .NET outlines two ways to sort: sorting group values, sorting data in the Data band.

The first type of sorting is available to us when we create a group, namely when setting up the Group Headline band. When you choose the field you're going to group on, you can sort it right away.

 

There are three sorting options available: no sorting, ascending, descending.

But if we talk about sorting basic data in the data bin, we can access more advanced sorting - three fields at once, and for each of them you can choose the order of sorting.

To call a sorting editor, you need to click the band's header twice on the page template.

 

Despite the user-friendly interface, this tool has one significant drawback. To be precise it can sort only three fields. However, some of the tables have a variety of fields, and you may need to sort by more than 3 fields.

You can bypass this restriction by sorting the data in the source using the query. You can do this either by creating a data source or by a source you've already created, directly for the desired table.

In the first case, we're just writing a request to get the data in the right order. The second case is the same, but in a data source that has already been created.

In the data tree, choose the right table. In the property inspector, we ask SelectCommand.

 

It is alled by the wizard to create an SQL query. You can enter a query manually or use the Query Builder. So you can sort of arbitrary number of fields:

1
SELECT * FROM customer ORDER BY Country, City, State, CustNo, Company

 When you create a data source, you may not be aware that you need a certain order data. But you can always add a request in an existing data source. However, this method does not work with non-SQL databases.

about product buy
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.NET FastReport
Comments
Axit Systems
710 days ago
Nice feature, but, as we use FastReport 6 for VCL, is it avalaible or planned for it ?

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy