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) { if (!(bool)Report.GetParameterValue("Jogviszony")) { txtTitle.Text = "Iskolalátogatási igazolás"; txtJogviszonyKezdete.Visible = false; txtJogviszonyKezdete.Height = 0; txtJogviszonyVarhatoBefejezese.Visible = false; txtJogviszonyVarhatoBefejezese.Height = 0; } DataSourceBase fejlecDS = Report.GetDataSource("Fejlec"); Data2.DataSource = fejlecDS; fejlecDS.Init(); DataSourceBase tanulokDS = Report.GetDataSource("Tanulok"); Data1.DataSource = tanulokDS; Relation rel0 = new Relation(); rel0.ParentDataSource = fejlecDS; rel0.ChildDataSource = tanulokDS; rel0.ParentColumns = new string[] { "OsztalyId" }; rel0.ChildColumns = new string[] { "OsztalyId" }; Report.Dictionary.Relations.Add(rel0); tanulokDS.Init(fejlecDS); // ds.Columns.FindByName // if (!(bool)Report.GetParameterValue("Jogviszony")) // { // } string tagintezmenyCim = (string)Report.GetParameterValue("TagintezmenyCim"); if(!string.IsNullOrWhiteSpace(tagintezmenyCim)) { Text16.Text = tagintezmenyCim + Environment.NewLine + "[Kelt]"; } else { Text99.Top -= Text26.Height; Text26.Printable = false; } string alulirottMegnevezese = Report.Parameters.FindByName("AlulirottMegnevezese").Value.ToString(); int index = alulirottMegnevezese.IndexOf(" - "); string nev = alulirottMegnevezese.Substring(0, index).Trim(); string beosztas = alulirottMegnevezese.Substring(index + " - ".Length).Trim(); Text18.Text = nev + "\r\n" + beosztas; } } }