RegisterData problem
hi,
i m using webreport and trying to register my business object like this;
protected void WebReport1_StartReport(object sender, EventArgs e)
{
//..
//Load Product List by Custom Business Objects
//
WebReport1.Report.Load(Server.MapPath("Products.frx"));
WebReport1.Report.RegisterData(ProductsList, "ProductsList");
WebReport1.Report.GetDataSource("ProductsList").Enabled = true;
((FastReport.DataBand)WebReport1.Report.FindObject("Data1")).DataSource = WebReport1.Report.GetDataSource("ProductsList");
((FastReport.DataBand)WebReport1.Report.FindObject("Data1")).DataSource.Enabled = true;
}
and html
<cc1:WebReport ID="WebReport1" runat="server" OnStartReport="WebReport1_StartReport" />
when i run this page, report is opening and there are 5 rows but all rows are blank.
but the products list has 5 rows with values.. and each list item has a custom object with public properties..
please help me..
thanks in advance..
i m using webreport and trying to register my business object like this;
protected void WebReport1_StartReport(object sender, EventArgs e)
{
//..
//Load Product List by Custom Business Objects
//
WebReport1.Report.Load(Server.MapPath("Products.frx"));
WebReport1.Report.RegisterData(ProductsList, "ProductsList");
WebReport1.Report.GetDataSource("ProductsList").Enabled = true;
((FastReport.DataBand)WebReport1.Report.FindObject("Data1")).DataSource = WebReport1.Report.GetDataSource("ProductsList");
((FastReport.DataBand)WebReport1.Report.FindObject("Data1")).DataSource.Enabled = true;
}
and html
<cc1:WebReport ID="WebReport1" runat="server" OnStartReport="WebReport1_StartReport" />
when i run this page, report is opening and there are 5 rows but all rows are blank.
but the products list has 5 rows with values.. and each list item has a custom object with public properties..
please help me..
thanks in advance..
Comments
When you register a business object this way, FastReport actually does nothing. You should go the designer, "Data|Choose Report Data" menu and check the necessary datasources/fileds. Try to replace
WebReport1.Report.RegisterData(ProductsList, "ProductsList");
with
WebReport1.Report.RegisterData(ProductsList, "ProductsList", 3);
where 3 is max. nesting level of your business object.
i tried also add an ObjectDataSource and chose it for DataSource but then, class public properties does not seem in report designer..
i m trying to make your said but something is going wrong.. How can i solve this problem? i attached a sample web site for this issue..
thanks for your helps..
i changed my approach last night.. Now, i only using ObjectDataSource and not other code..
My ObjectDataSource has public properties and a method for select. Select Method returns List<Products>
and everything goes OK.
Now i m looking for grouping. My product objects has a type property and i want to group report by type..
i hope, i can do this quickly and easily..