Assign list data to report problem

I try to use designer to create report, as need to debug purpose, from the report will connect my mssql database to get fields and column, so the report.frx will be like

<MsSqlDataConnection Name="Datasource" ConnectionString="....">

   <TableDataSource Name="Table" Alias="BS" DataType="System.Int32" Enabled="true" SelectCommand="select * from [dbo].[fn_glBSReport] ('2023-3-31','2022-4-1')">

    <Column Name="Id" DataType="System.Int32"/>

    <Column Name="AccountTypeId" DataType="System.Int32"/>

    <Column Name="AccountType" DataType="System.String"/>

    <Column Name="AccountCode" DataType="System.String"/>

    <Column Name="BalanceAmt" DataType="System.Decimal"/>

   </TableDataSource>

  </MsSqlDataConnection>

In the dotnet, for load this report, I don't need to pass sql connection to this report, just use report.load(dataObjects, "BS");

from frx I remove <MsSqlDataConnection Name="Datasource" ConnectionString="...."> </MsSqlDataConnection>

but finally , it's throw the exception which said

FastReport.Utils.DataTableException: BS: Table is not connected to the data. Register the data using Report.RegisterData method.

  at FastReport.Data.TableDataSource.LoadData(ArrayList rows)

  at FastReport.Data.DataSourceBase.LoadData()

  at FastReport.Data.DataSourceBase.Init(Relation relation, String filter, SortCollection sort, Boolean useAllParentRows)

  at FastReport.Data.DataSourceBase.Init(DataSourceBase parentData, String filter, SortCollection sort, Boolean useAllParentRows)

for this case, how to handle it ?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.