How can I do it? Actually how is it done in "Business Objects.frx" report? As far as I can see there is no way to do it but still it is done in that report.
      List<Category> list = new List<Category>();
      Category category = new Category("Beverages", "Soft drinks, coffees, teas, beers");
      category.Products.Add(new Product("Chai", 18m));
      category.Products.Add(new Product("Chang", 19m));
      category.Products.Add(new Product("Ipoh coffee", 46m));
      list.Add(category);
      category = new Category("Confections", "Desserts, candies, and sweet breads");
      category.Products.Add(new Product("Chocolade", 12.75m));
      category.Products.Add(new Product("Scottish Longbreads", 12.5m));
      category.Products.Add(new Product("Tarte au sucre", 49.3m));
      list.Add(category);
      category = new Category("Seafood", "Seaweed and fish");
      category.Products.Add(new Product("Boston Crab Meat", 18.4m));
      category.Products.Add(new Product("Red caviar", 15m));
      list.Add(category);
      FReport.Load(...);
      FReport.RegisterData(list, "Categories BusinessObject", BOConverterFlags.AllowFields, 3);
      FReport.Show();
// business objects
    public class Category
    {
      public string Name;
      public string Description;
      public List<Product> Products;
      public Category(string name, string description)
      {
        Name = name;
        Description = description;
        Products = new List<Product>();
      }
    }
    public class Product
    {
      public string Name;
      public decimal UnitPrice;
      public Product(string name, decimal unitPrice)
      {
        Name = name;
        UnitPrice = unitPrice;
      }
    }
Thanks but this is in code. I want to know how can I do this in Designer.
For example, when you open Business Objects.frx report in Designer and click Data -> Data Sources you can see the Business Objects DataSource. However if I want to add a DataSource i can only add DB data sources, not lists.
It can be done in Visual Studio IDE, "Data|Add New Data Source..." menu.
- create new datasource which is bound to an object in your application;
- add "BindingSource" component and connect it to your datasource;
- put the "Report" component on your form, invoke its designer. You will be asked to choose a datasource. Select your BindingSource object.
Note that in design-time, you cannot preview a report, because datasource is empty. This can be done in run-time only. In run-time, you should instantiate your datasource, fill it with data, then run a report.
It can be done in Visual Studio IDE, "Data|Add New Data Source..." menu.
- create new datasource which is bound to an object in your application;
- add "BindingSource" component and connect it to your datasource;
- put the "Report" component on your form, invoke its designer. You will be asked to choose a datasource. Select your BindingSource object.
Note that in design-time, you cannot preview a report, because datasource is empty. This can be done in run-time only. In run-time, you should instantiate your datasource, fill it with data, then run a report.
Hi,
I am evaluating Fast Reports for .net.
I have visual studio 2013. I am having trouble doing this step "add BindingSource component and connect it to your datasource;" can you make an example?
Comments
Here is how I do this in the demo:
For example, when you open Business Objects.frx report in Designer and click Data -> Data Sources you can see the Business Objects DataSource. However if I want to add a DataSource i can only add DB data sources, not lists.
- create new datasource which is bound to an object in your application;
- add "BindingSource" component and connect it to your datasource;
- put the "Report" component on your form, invoke its designer. You will be asked to choose a datasource. Select your BindingSource object.
Note that in design-time, you cannot preview a report, because datasource is empty. This can be done in run-time only. In run-time, you should instantiate your datasource, fill it with data, then run a report.
Maybe someone can suggest better solution
Hi,
I am evaluating Fast Reports for .net.
I have visual studio 2013. I am having trouble doing this step "add BindingSource component and connect it to your datasource;" can you make an example?
Thanks.