The new build (1.1.20) comes with completely new engline that handles business objects (BO). The new engine was designed to overcome the following restrictions of old engine:
- when registering a business object, you have to indicate maximum nesting level. It was needed because not all BOs have tree-like structure, some of them use parent-child relations, which may lead to infinite loop. This is no longer needed with the new engine: you may have as many nested objects as you want - just go "Data|Choose Report Data..." dialog and expand elements that you want to use;
- old BO engine was not able to correctly represent nested IEnumerable elements if they were contained in another (non-IEnumerable type) properties. For example, consider the following class structure:
CODE
public class Master
{
public DetailInfo Info { get; set; }
}
public class DetailInfo
{
public List<Detail> Detail { get; set; }
}
public class Detail
{
public int SomeProperty { get; set; }
}
{
public DetailInfo Info { get; set; }
}
public class DetailInfo
{
public List<Detail> Detail { get; set; }
}
public class Detail
{
public int SomeProperty { get; set; }
}
in the old version, this was converted to the following data tree:
CODE
Master
|
+- Info
|
+- Detail
|
+- Info
|
+- Detail
(i.e. the Detail datasource belongs to Master which is confusing)
The new version handles this more natural:
CODE
Master
|
+- Info
|
+- Detail
|
+- Info
|
+- Detail
Unfortunately, this is a breaking change. Here is a list of issues that should be corrected:
1) The
report.RegisterData(IEnumerable, string, BOConverterFlags, int)
method is kept for compatibility only. Instead of it, use
report.RegisterData(IEnumerable, string)
-or-
report.RegisterData(IEnumerable, string, int)
The latter method creates n-level initial datasource structure and may be used if you create a report in code. In other cases, use the first method.
2) New BO engine can handle public properties only. Fields cannot be handled anymore. If you have a code like
CODE
public MyClass
{
public string MyField;
}
{
public string MyField;
}
you need to convert the field to a property:
CODE
public MyClass
{
private string _myField;
public string MyField
{
get { return _myField; }
set { _myField = value; }
}
}
{
private string _myField;
public string MyField
{
get { return _myField; }
set { _myField = value; }
}
}
3) New BO engine handles nested IEnumerable properties differently, as stated above. Due to this new behavior, you have to change your reports (that use nested business objects) accordingly:
- open the report in FR designer;
- go "Data|Choose Report Data..." window and uncheck the root element (in the sample above - the "Master"). Close the dialog;
- save the report;
- open the report again;
- go "Data|Choose Report Data..." window and check datasources you need;
The steps above are needed to delete old (bad) data objects that is stored in the report file, and create new ones. Now attach new data objects to report items:
- assign appropriate datasources to each databand in your report (double-click the databand and select datasource). If you use the "Matrix" object, check its "DataSource" property as well;
- you may also need to change Text objects. In the sample class above, to access the Detail.SomeProperty, you have to use its full path: "Master.Info.Detail.SomeProperty". In earlier version, the path was: "Master.Detail.SomeProperty" - you have to correct this.
