Register application objects as a data source in .NET 8.0 and make their fields available to the report template.

Registering objects. In the report action, pass your collection to RegData under a name that matches the template:
public IActionResult GetReportITypedList()
{
    var report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "Reports/BusinessObjects_ITypedList.mrt"));
    report.RegData("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees());
    return StiNetCoreViewer.GetReportResult(this, report);
}

public IActionResult GetReportIEnumerable()
{
    var report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "Reports/BusinessObjects_IEnumerable.mrt"));
    report.RegData("EmployeeIEnumerable", CreateBusinessObjectsIEnumerable.GetEmployees());
    return StiNetCoreViewer.GetReportResult(this, report);
}
Binding to business objects lets a report consume the very same domain classes your application already uses, whether they expose data through IEnumerable or the richer ITypedList interface, without converting them to datasets first.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.