Changing Business-Object DataSource afterwards
Let's take this BO-model for example:
public List<Contracts> Root
class Contract
{
string ContractID {get; set;}
Company Buyer {get; set;}
Company Seller {get; set;}
}
class Company
{
int Number {get; set;}
List<Person> Employees {get; set;}
Country AtCountry {get; set;}
}
class Person
{
string Name {get; set;}
Country AtCountry {get; set;}
}
class Country
{
string Name {get; set;}
}
We register the data by code using "report.RegisterData(Root, "Root", 4)" and build a FRX from scratch. We do use bands that iterate the contracts, complanies, persons etc.
We save this FRX and all is fine!
Sometime LATER we need to expand our BO-model by new simple properties or even whole new classes in lists.
E.g.:
class Country
{
string Name {get; set;}
string ShortName {get; set;} // NEW simple prop
}
class User // NEW class
{
string Name {get; set;}
string Phone {get; set;}
}
class Contract
{
string ContractID {get; set;}
Company Buyer {get; set;}
Company Seller {get; set;}
User MainReferee {get; set;} // NEW complex prop
List<User> Referees {get; set;} // NEW List of class
}
Now what exactly is the right way in code to change the DataSource afterwards so that:
a) all new props/classes are aviable in the designer
[img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> all existing bands do keep their binded datasources (iterations) c) the filesize of the FRX does not "explode" (in detail the dictionary containg the datasources get extremely large)[/img]
public List<Contracts> Root
class Contract
{
string ContractID {get; set;}
Company Buyer {get; set;}
Company Seller {get; set;}
}
class Company
{
int Number {get; set;}
List<Person> Employees {get; set;}
Country AtCountry {get; set;}
}
class Person
{
string Name {get; set;}
Country AtCountry {get; set;}
}
class Country
{
string Name {get; set;}
}
We register the data by code using "report.RegisterData(Root, "Root", 4)" and build a FRX from scratch. We do use bands that iterate the contracts, complanies, persons etc.
We save this FRX and all is fine!
Sometime LATER we need to expand our BO-model by new simple properties or even whole new classes in lists.
E.g.:
class Country
{
string Name {get; set;}
string ShortName {get; set;} // NEW simple prop
}
class User // NEW class
{
string Name {get; set;}
string Phone {get; set;}
}
class Contract
{
string ContractID {get; set;}
Company Buyer {get; set;}
Company Seller {get; set;}
User MainReferee {get; set;} // NEW complex prop
List<User> Referees {get; set;} // NEW List of class
}
Now what exactly is the right way in code to change the DataSource afterwards so that:
a) all new props/classes are aviable in the designer
[img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> all existing bands do keep their binded datasources (iterations) c) the filesize of the FRX does not "explode" (in detail the dictionary containg the datasources get extremely large)[/img]
Comments