Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FastReport .NET RegisterData

There is a method in fastreport called RegisterData that creates initial datasource and bind data to it. So, I found a report that is already working in project, but when I'm trying to do the same thing I don't see any datasources in it.

var data = GetData(parameters) as IEnumerable<Days>;
Report.RegisterData(data, "DaysBS", 4)

When I try to select data source from design mode I can't see any? Who knows why? In already excisting report all works fine and I can see all registered datasources

Report.RegisterData(data, "UnUsedPeriodsBS", 4);
var vacationUnUsedPeriodDatas = data.SelectMany(d => d.Periods).ToList();
Report.RegisterData(vacationUnUsedPeriodDatas, "PeriodDetailsBS", 4);
Report.RegisterData(vacationUnUsedPeriodDatas.SelectMany(s => s.PeriodDetails).ToList(), "DaysDetailsBS", 4);

EDIT Tried to manually refer to DaysBS in report design mode and it's working, but I can't understand why I can't see any report data from design mode

like image 322
Potato Avatar asked Aug 30 '25 16:08

Potato


1 Answers

but I can't understand why I can't see any report data from design mode

Try to set tables from your dataset enabled:

Report.GetDataSource("tableName").Enabled = true;
like image 200
xaml Avatar answered Sep 19 '25 12:09

xaml