|
main
{
//Assign the datasource to the business object for report 1 implementation
oGridView1.DataSource = oBusinessObject1;
// Make the object of report1
oBaseReport = new oRpt1;
// Make the object of cross star
// and pass report1 object and grid object
// to the construnction function
oCrossStar = new CrossStar();
crosStar.Construct(oBaseReport, oGridView1)
//Bind the grid
oGridView1.DataBind();
//Assign the datasource to the business object for report 2 implementation
oGridView2.DataSource = oBusinessObject2;
// Make the object of report2
oBaseReport = new oRpt2;
crosStar.Construct(oBaseReport, oGridView2)
//Bind the grid
oGridView2.DataBind();
}
class CrossStar
{
Construct(oBaseReport, oGridView1)
{
oBaseReport.buildBindFields(oGridView1);
oBaseReport.buildTemplateFields(oGridView1);
}
}
abstract class BaseReport
{
//Functions to add bind and template fields
buildBindFields(oGridView1)
buildTemplateFields(oGridView1)
}
class Rpt1: BaseReport
{
//Implementation of functions to add bind and template fields
//Implimentation based on report 1 structure
buildBindFields(oGridView1)
buildTemplateFields(oGridView1)
}
class Rpt2: BaseReport
{
//Implementation of functions to add bind and template fields
//Implimentation based on report 2 structure
buildBindFields(oGridView1)
buildTemplateFields(oGridView1)
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.