Hello Dmytro,
I made the following changes to the previously provided application:
In the ClassLibrary:
1. Remove the Cars and Items classes.
2. Create a new class named Data and add the following properties:
public class Data
{
public List<Car> Cars { get; set; }
public List<Item> Items { get; set; }
}
3. Create a class named Generator where we will add the data:
public class Generator
{
public List<Item> Items()
{
List<Item> items = new List<Item>();
Item item;
item = new Item("Reporting", 599);
items.Add(item);
item = new Item("DevCraft", 1499);
items.Add(item);
return items;
}
public List<Car> Cars()
{
List<Car> cars = new List<Car>();
Car car;
car = new Car("Honda", "NSX GT", 2003);
cars.Add(car);
car = new Car("Nissan", "Skyline R34 GT-R", 2005);
cars.Add(car);
car = new Car("Audi", "S4", 2006);
cars.Add(car);
return cars;
}
public Data Generate()
{
Data data = new Data() { Cars = this.Cars(), Items = this.Items() };
return data;
}
}
3. Rebuild the solution.
Go to the ReportLibrary:
1. Remove the datasources;
2. Add a new ObjectDataSource and set is as follows:
- in Choose a Business Object dialog, select Generator;
- in Choose a Data Member -> Generate() : Data;
3. Set the ObjectDataSource to be the DataSource of the report;
4. Set the datasource of the tables through the following Bindings:
Property path: DataSource
Expression: =Fields.Cars / =Fields.Items
Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items