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_ManualBuild(object sender, EventArgs e)
{
bool isLezartNaplo;
Boolean.TryParse(Report.Parameters.FindByName("isLezartNaplo").Value.ToString(), out isLezartNaplo);
if (isLezartNaplo)
{
OsztalyozoLezaras.Visible = true;
}
// Naptari hetek
DataSourceBase DataNaptariHetek = Report.GetDataSource("NaptariHetek");
Data5.DataSource = DataNaptariHetek;
DataNaptariHetek.Init();
//Napló
DataSourceBase Naplo = Report.GetDataSource("Naplo");
Data7.DataSource = Naplo;
Relation rel2 = new Relation();
rel2.Name = "GetNaplo";
rel2.ParentDataSource = DataNaptariHetek;
rel2.ChildDataSource = Naplo;
rel2.ParentColumns = new string[] { "Het" };
rel2.ChildColumns = new string[] { "Het" };
Report.Dictionary.Relations.Add(rel2);
Naplo.Init(DataNaptariHetek);
//Napló adatok
DataSourceBase NaploAdatok = Report.GetDataSource("NaploAdatok");
Data9.DataSource = NaploAdatok;
Relation rel4 = new Relation();
rel4.Name = "GetNaplo";
rel4.ParentDataSource = Naplo;
rel4.ChildDataSource = NaploAdatok;
rel4.ParentColumns = new string[] { "Datum" };
rel4.ChildColumns = new string[] { "Datum" };
Report.Dictionary.Relations.Add(rel4);
NaploAdatok.Init(Naplo);
//Napló mulasztások
DataSourceBase NaploMulasztas = Report.GetDataSource("NaploMulasztas");
Data10.DataSource = NaploMulasztas;
Relation rel3 = new Relation();
rel3.Name = "NaploMulasztas";
rel3.ParentDataSource = DataNaptariHetek;
rel3.ChildDataSource = NaploMulasztas;
rel3.ParentColumns = new string[] { "Het" };
rel3.ChildColumns = new string[] { "Het" };
Report.Dictionary.Relations.Add(rel3);
NaploMulasztas.Init(DataNaptariHetek);
// Tanulók mulasztásai
DataSourceBase tanuloAlapadatok = Report.GetDataSource("TanuloAdatok");
Data8.DataSource = tanuloAlapadatok;
DataSourceBase tanuloMulasztasai = Report.GetDataSource("TanuloMulasztas");
Data6.DataSource = tanuloMulasztasai;
Relation rel = new Relation();
rel.Name = "TanuloMulasztasai";
rel.ParentDataSource = tanuloAlapadatok;
rel.ChildDataSource = tanuloMulasztasai;
rel.ParentColumns = new string[] { "Id", "TanuloCsoportId" };
rel.ChildColumns = new string[] { "tanuloid", "TanuloCsoportId" };
Report.Dictionary.Relations.Add(rel);
tanuloMulasztasai.Init(tanuloAlapadatok);
//Tanuló feljegyzései
DataSourceBase tanuloFeljegyzesek = Report.GetDataSource("TanuloFeljegyzesek");
Data11.DataSource = tanuloFeljegyzesek;
Relation rel5 = new Relation();
rel5.Name = "tanuloFeljegyzesek";
rel5.ParentDataSource = tanuloAlapadatok;
rel5.ChildDataSource = tanuloFeljegyzesek;
rel5.ParentColumns = new string[] { "Id" };
rel5.ChildColumns = new string[] { "Tanulo" };
Report.Dictionary.Relations.Add(rel5);
tanuloFeljegyzesek.Init(tanuloAlapadatok);
//Gondviselő
DataSourceBase tanuloGonviselokAdatai = Report.GetDataSource("TanuloGonviselokAdatai");
DataTanuloGondviselo.DataSource = tanuloGonviselokAdatai;
Relation rel33 = new Relation();
rel33.Name = "TanuloGondviselo";
rel33.ParentDataSource = tanuloAlapadatok;
rel33.ChildDataSource = tanuloGonviselokAdatai;
rel33.ParentColumns = new string[] { "Id" };
rel33.ChildColumns = new string[] { "TanuloId" };
Report.Dictionary.Relations.Add(rel33);
tanuloGonviselokAdatai.Init(tanuloAlapadatok);
}
private void FejlecOldal_StartPage(object sender, EventArgs e)
{
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();
Text16.Text = nev + "\r\n" + beosztas;
Text86.Text = Text16.Text;
}
}
}