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)
{
string Kelt = Report.Parameters.FindByName("Kelt").Value.ToString();
DateTime KeltNap = DateTime.Parse(Kelt);
DateTime TanuloSzulDat = DateTime.Parse(((string)Report.GetColumnValue("TanuloAdatok.szulIdo")));
if (TanuloSzulDat.AddYears(18) > KeltNap)
{
Cell153.Text = "név: [TanuloAdatok.GondviseloNeve]";
Cell155.Text = "lakcím: [TanuloAdatok.GondviseloCime]";
Cell157.Text = "tel.: [TanuloAdatok.GondviseloTelSzam]" + Environment.NewLine + "e-mail: [TanuloAdatok.GondviseloEmail]";
}
DataSourceBase tanuloAdatok = Report.GetDataSource("TanuloAdatok");
TanuloAlapAdatok.DataSource = tanuloAdatok;
tanuloAdatok.Init();
DataSourceBase besorolasAdatok = Report.GetDataSource("Besorolas");
Besorolasa.DataSource = besorolasAdatok;
Relation rel2 = new Relation();
rel2.Name = "TanuloEler";
rel2.ParentDataSource = tanuloAdatok;
rel2.ChildDataSource = besorolasAdatok;
rel2.ParentColumns = new string[] { "tanuloId" };
rel2.ChildColumns = new string[] { "tanuloId" };
Report.Dictionary.Relations.Add(rel2);
besorolasAdatok.Init(tanuloAdatok);
DataSourceBase intezmenyAdatok = Report.GetDataSource("IntezmenyAdatok");
Intezmeny.DataSource = intezmenyAdatok;
intezmenyAdatok.Init();
string alulirottMegnevezese = Report.Parameters.FindByName("AlulirottMegnevezese").Value.ToString();
int index = alulirottMegnevezese.IndexOf(" - ");
string nev = alulirottMegnevezese.Substring(0, index).Trim();
Cell69.Text = "Törvényes képviselőjének neve: " + nev;
}
}
}