This example shows how to use the Linq queries in the report data. Linq syntax allows you to perform complex filtering, ordering and grouping operations when working with data sources, and using a minimum of code. For this, you can use the method for working with Business Objects:
public Form1()
{
InitializeComponent();
Item[] items = new Item[] { new Book{Id = 1, Price = 13.50, Genre = "Comedy", Author = "Jim Bob"},
new Book{Id = 2, Price = 8.50, Genre = "Drama", Author = "John Fox"},
new Movie{Id = 1, Price = 22.99, Genre = "Comedy", Director = "Phil Funk"},
new Movie{Id = 1, Price = 13.40, Genre = "Action", Director = "Eddie Jones"}};
var query1 = from i in items
where i.Price > 9.99
orderby i.Price
select i;
report.Load("..\\Report.mrt");
report.RegBusinessObject("MyData", "MyData", query1);
}
На скриншоте ниже Вы можете увидеть результат выполнения данного кода: