0

I am trying to populate my fast report with dummy data using .NET code

DataTable dt = new DataTable();
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("days", typeof(string));
dt.Columns.Add("court", typeof(string));

dt.Rows.Add("John Doe", "5", "Court A");
dt.Rows.Add("Jane Smith", "10", "Court B");
dt.Rows.Add("Alice Johnson", "7", "Court C");

WebReport1.Report?.Dispose();
WebReport1.Report = new FastReport.Report();

WebReport1.Report.Load(Server.MapPath("~/reports_frx/ReportCourtDuration.frx"));

WebReport1.Report.RegisterData(dt, "Results");
WebReport1.Report.GetDataSource("Results").Enabled = true;

WebReport1.Report.Prepare();
WebReport1.Visible = true;

Also this is my .frx file is which I am trying to populate.

<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="2025-10-07" ReportInfo.CreatorVersion="1.9.1.0">
  <Dictionary>
    <TableDataSource Name="Results" ReferenceName="Results" DataType="System.Data.DataTable" Enabled="true">
      <Column Name="name" DataType="System.String"/>
      <Column Name="days" DataType="System.String"/>
      <Column Name="court" DataType="System.String"/>
    </TableDataSource>
  </Dictionary>

  <ReportPage Name="Page1">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8" />
    <PageHeaderBand Name="PageHeader1" Top="41.65" Width="718.2" Height="18.9">
      <TextObject Name="Header1" Left="10" Width="200" Height="18.9" Text="Name" Font="Arial,10,Bold" />
      <TextObject Name="Header2" Left="220" Width="100" Height="18.9" Text="Days" Font="Arial,10,Bold" />
      <TextObject Name="Header3" Left="330" Width="100" Height="18.9" Text="Court" Font="Arial,10,Bold" />
    </PageHeaderBand>

    <DataBand Name="Data1" Top="65" Width="718.2" Height="18" DataSource="Results">
      <TextObject Name="Text1" Left="10" Width="200" Height="18" Text="[Results.name]" />
      <TextObject Name="Text2" Left="220" Width="100" Height="18" Text="[Results.days]" />
      <TextObject Name="Text3" Left="330" Width="100" Height="18" Text="[Results.court]" />
    </DataBand>

    <PageFooterBand Name="PageFooter1" Top="90" Width="718.2" Height="18.9" />
  </ReportPage>
</Report>

I have tried several solutions but with no results.

What is my mistake?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.