Problem to the show report
Hi,
I've been testing the Fast Report Open Source, but when I fill data, it throw exception:
"Object reference not set to an instance of an object.", StackTrace FastReport.Data.DataSourceBase.RowComparer..ctor (Report report, DataSourceBase dataSource, String [] expressions, Boolean [] descending) ...
// Code
model.WebReport.Report.Load (Path.Combine (ReportsFolder(), "MyReport.frx"));
PostgresDataConnection conn = new PostgresDataConnection ();
conn.ConnectionString = "myconnection";
conn.CreateAllTables ();
model.WebReport.Report.Dictionary.Connections.RemoveAt (0);
model.WebReport.Report.Dictionary.Connections.Add (conn);
model.WebReport.Report.RegisterData (ds.Tables [0], "Data");
model.WebReport.Report.FindObject ("Data"). SetName ("DataReport"); //Name how is in the .frx report
model.WebReport.Report.Prepare (); // when it reach here exception
model.WebReport.Report.Refresh ();
Note: The columns of report are the same of DataTable,
Comments
Hello!
Check the DataBand.Sort collection in all bands of the template: the sort expression (for example, [DataReport.Name]) must exactly match the new name of the registered data source and contain no syntax errors.
For programmatic registration of a DataTable, make sure you call RegisterData(table, “DataReport”) and set GetDataSource(“DataReport”).Enabled = true; (if the PostgresDataConnection from the .frx file is no longer needed, delete or disable it)