# LINQ

This topic demonstrates how to use LINQ in an ActiveReports report.

## Content



The LINQ sample demonstrates how to use LINQ in an ActiveReports report.

![ActiveReports report using LINQ](https://cdn.mescius.io/document-site-files/images/b298aea2-8cb8-4a0f-be88-4f54aa263ebd/images/linqsample.png)

Sample Location

Visual Basic.NET

[https://github.com/activereports/Samples19/tree/main/DataBinding/Section/LINQ/VB.NET](https://github.com/activereports/Samples19/tree/main/DataBinding/Section/LINQ/VB.NET)

C#

[https://github.com/activereports/Samples19/tree/main/DataBinding/Section/LINQ/C#](https://github.com/activereports/Samples19/tree/main/DataBinding/Section/LINQ/C%23)

Run-Time Features

This sample uses a LINQ Query to sort recordsets in descending order of age. The resultant recordsets are converted to an IList and used as a data source for the report which is displayed in Viewer control.

Project Details

ViewerForm

Displays the report output results. ToList method is set in **DataSource** property of the report to extract objects that use LINQ.

rptLINQtoObject report

The report DataSource is a list of Person constructor created from generic class. Creates a query to sort in descending order of Age.