Private voidBtnprint_click (Objectsender, EventArgs e) { //print master and slave table data stringFile = Application.startuppath@"\masterdetail.frx"; Rptmasterdetail.load (file);//To load a report template fileDataSet DS= DAL. Getmasterdetaildata ();//Fetching report DataRptmasterdetail.registerdata (ds. tables[0],"Tb_so");//registering a data source, primary tableRptmasterdetail.registerdata (ds. tables[1],"Tb_sos");//registering a data source from a table// //registering a DataSet directly is OK, but you must specify a table name for Dataset.tables! //Fastreport is a DataTable object that is followed by a table name. // //Rptmasterdetail.registerdata (DS); // //bind data Source to Databand (primary table data)Databand Masterband = Rptmasterdetail.findobject ("Data1") asDataband; Masterband.datasource= Rptmasterdetail.getdatasource ("Tb_so");//Main Table//bind a data source to Databand (detail data)Databand Detailband = Rptmasterdetail.findobject ("Data2") asDataband; Detailband.datasource= Rptmasterdetail.getdatasource ("Tb_sos");//Schedule//Important!! Set the primary foreign key relationship for the schedule! Detailband.relation =NewRelation (); DetailBand.Relation.ParentColumns=New string[] {"SONO" }; DetailBand.Relation.ParentDataSource= Rptmasterdetail.getdatasource ("Tb_so");//Main TableDetailBand.Relation.ChildColumns =New string[] {"SONO" }; DetailBand.Relation.ChildDataSource= Rptmasterdetail.getdatasource ("Tb_sos");//Schedule//ready to work, Show report preview formRptmasterdetail.prepare (); Rptmasterdetail.showprepared (true, This); }