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 Table2_ManualBuild(object sender, EventArgs e) { // initialize the data DataSourceBase data = Report.GetDataSource("Categories"); data.Init(); // print table header Table2.PrintRow(0); Table2.PrintColumns(); data.First(); while (data.HasMoreRows) { // print table body Table2.PrintRow(1); Table2.PrintColumns(); // go next data row data.Next(); } } private void Table3_ManualBuild(object sender, EventArgs e) { // get the data source by its name DataSourceBase columnData = Report.GetDataSource("Employees"); // init the data source columnData.Init(); // print the first table column - it is a header Table3.PrintColumn(0); // each PrintColumn call must be followed by either PrintRow or PrintRows call // to print cells on the column Table3.PrintRows(); // now enumerate the data source and print the table body while (columnData.HasMoreRows) { // print the table body Table3.PrintColumn(1); Table3.PrintRows(); // go next data source row columnData.Next(); } // print the last table column - it is a footer Table3.PrintColumn(2); Table3.PrintRows(); } } }