Changes in business objects engine
Hello everybody,
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:
in the old version, this was converted to the following data tree:
(i.e. the Detail datasource belongs to Master which is confusing)
The new version handles this more natural:
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
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.
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:
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; }
}
in the old version, this was converted to the following data tree:
Master
|
+- Info
|
+- Detail
(i.e. the Detail datasource belongs to Master which is confusing)
The new version handles this more natural:
Master
|
+- 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
public MyClass
{
  public string MyField;
}
you need to convert the field to a property:
public MyClass
{
  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.
Comments
Regards,
Louise
Pret travaux
Thanks
{
public DetailInfo Info { get; set; }
}
public class DetailInfo
{
public List<Detail> Detail { get; set; }
}
public class Detail
{
public int SomeProperty { get; set; }
Unfortunately, this coding set is not working in mine.
peace out~
(e.g: Some properties has a value as DELEGATE... If report check these properties, it throws an exception when I execute 'RegisterData').
So, Will I cannot say that, only see properties that have [Browsable(true)] attribute??
May
hairmax lasercomb review rogaine side effects .
No doubt, have you tried this out yet? I couldn't get it to work. I must be missing something as I am getting some error messages.
Ragards, B
I was wondering the same....... Anyone have an answer?
I have the same problem and I can't fix it.