using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; using System.Drawing; using System.Data; using FastReport; using FastReport.Data; using FastReport.Dialog; using FastReport.Barcode; using FastReport.Table; using FastReport.Utils; namespace FastReport { public class ReportScript { private void Page1_StartPage(object sender, EventArgs e) { DataSourceBase master = Report.GetDataSource("Fejlec"); master.Init(); DataSourceBase detail1 = Report.GetDataSource("NapokAzon"); Relation rel1 = new Relation(); rel1.Name = "kapcsolat"; rel1.ParentDataSource = master; rel1.ChildDataSource = detail1; rel1.ParentColumns = new string[] { "EvHonap", "HelyettesitoId" }; rel1.ChildColumns = new string[] { "EvHonap", "HelyettesitoId" }; Report.Dictionary.Relations.Add(rel1); detail1.Init(master); Data4.DataSource = detail1; DataSourceBase detail = Report.GetDataSource("Helyettesitesek"); Relation rel = new Relation(); rel.Name = "kapcsolat"; rel.ParentDataSource = master; rel.ChildDataSource = detail; rel.ParentColumns = new string[] { "EvHonap", "HelyettesitoId" }; rel.ChildColumns = new string[] { "EvHonap", "HelyettesitoId" }; Report.Dictionary.Relations.Add(rel); detail.Init(master); Data3.DataSource = detail; DataSourceBase detail0 = Report.GetDataSource("Tablazat"); Relation rel0 = new Relation(); rel0.Name = "kapcsolat"; rel0.ParentDataSource = master; rel0.ChildDataSource = detail0; rel0.ParentColumns = new string[] { "EvHonap", "HelyettesitoId" }; rel0.ChildColumns = new string[] { "EvHonap", "HelyettesitoId" }; Report.Dictionary.Relations.Add(rel0); detail0.Init(master); Data2.DataSource = detail0; DataSourceBase detail5 = Report.GetDataSource("OsszTablazat"); Data5.DataSource = detail5; Relation rel5 = new Relation(); rel5.Name = "kapcsolat"; rel5.ParentDataSource = master; rel5.ChildDataSource = detail5; rel5.ParentColumns = new string[] { "EvHonap", "HelyettesitoId" }; rel5.ChildColumns = new string[] { "EvHonap", "HelyettesitoId" }; Report.Dictionary.Relations.Add(rel5); detail5.Init(master); int bontas = int.Parse(Report.Parameters.FindByName("bontas").Value.ToString()); switch(bontas) { case 0: // havi bontás Table7h.Delete(); Table10h.Delete(); Table4h.Delete(); break; case 1: // heti bontás Table7.Delete(); Table8.Delete(); Data4.Height = 0; Table10.Delete(); Table4.Delete(); Cell2.Text = "[Fejlec.EvHonap]. tanítási hét - Helyettesítés"; break; } } } }