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 (Report.Parameters.FindByName("Tipus").Value.ToString() == "ErtesitesJegyzonek")
{
CimzettText.Text = "Polgármesteri Hivatal Jegyzője";
}
else
{
CimzettText.Text = "Kormányhivatal";
}
string tagintezmenyCim = (string)Report.GetParameterValue("TagintezmenyCim");
if(!string.IsNullOrWhiteSpace(tagintezmenyCim))
{
Text50.Text = tagintezmenyCim + Environment.NewLine + "[Kelt]";
}
string alulirottMegnevezese = Report.Parameters.FindByName("AlulirottMegnevezese").Value.ToString();
int index = alulirottMegnevezese.IndexOf(" - ");
Text52.Text = alulirottMegnevezese.Substring(0, index).Trim();
Text53.Text = alulirottMegnevezese.Substring(index + " - ".Length).Trim();
DataSourceBase masterData = Data1.DataSource;
masterData.Init();
DataSourceBase rowData = Report.GetDataSource("GondviseloAdatok");
Data2.DataSource = rowData;
rowData.Init();
Relation rel = new Relation();
rel.Name = "Tanulo_Gondviselo";
rel.ParentDataSource = masterData;
rel.ChildDataSource = rowData;
rel.ParentColumns = new string[] { "TanuloId" };
rel.ChildColumns = new string[] { "TanuloId" };
Report.Dictionary.Relations.Add(rel);
}
private void Table4_BeforePrint(object sender, EventArgs e)
{
int hozottIgazolatlan = (int)Report.GetColumnValue("MulasztasFej.HozottIgazolatlan");
int hozottIgazolatlanKeses = (int)Report.GetColumnValue("MulasztasFej.HozottIgazolatlanKeses");
if ((hozottIgazolatlan == 0) && (hozottIgazolatlanKeses == 0))
{
Row17.Visible = false;
DataHeader3.Height = 56.7f;
}
else
{
Row17.Visible = true;
DataHeader3.Height = 85.05f;
}
}
}
}