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 ResultTable_AfterCalcBounds(object sender, EventArgs e)
{
// Táblázat szélességének beállítása
TableResult resultTable = sender as TableResult;
float tableWidth = resultTable.Width;
float pageWidth = Engine.PageWidth;
//if (tableWidth > pageWidth)
{
float ratio = pageWidth / tableWidth;
foreach (TableColumn column in resultTable.Columns)
{
column.AutoSize = false;
column.Width *= ratio;
}
resultTable.CalcHeight();
}
}
private void Page1_ManualBuild(object sender, EventArgs e)
{
// Tanulók
DataSourceBase tanuloAlapadatok = Report.GetDataSource("TanuloAlapAdatok");
DataTanuloAlapadatok.DataSource = tanuloAlapadatok;
tanuloAlapadatok.Init();
// Tanuló bejegyzései
DataSourceBase tanuloBejegyzes = Report.GetDataSource("TanuloBejegyzes");
DataTanuloBejegyzes.DataSource = tanuloBejegyzes;
Relation rel47848 = new Relation();
rel47848.ParentDataSource = tanuloAlapadatok;
rel47848.ChildDataSource = tanuloBejegyzes;
rel47848.ParentColumns = new string[] { "tanuloID", "TanuloCsoportId" };
rel47848.ChildColumns = new string[] { "tanuloID", "TanuloCsoportId" };
Report.Dictionary.Relations.Add(rel47848);
}
}
}