123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?xml version="1.0" encoding="utf-8"?>
- <Report ScriptLanguage="CSharp" ReportInfo.Description="Demonstrates how to print multiple Table columns wrapped. To do this: - select the Table object; - go to the "Properties" window and set the "Layout" property to Wrapped; - set the "WrappedGap" if needed." ReportInfo.Created="01/17/2008 20:54:09" ReportInfo.Modified="04/07/2023 13:50:11" ReportInfo.CreatorVersion="1.0.0.0">
- <ScriptText>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 Table1_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
- Table1.PrintColumn(0);
- // each PrintColumn call must be followed by either PrintRow or PrintRows call
- // to print cells on the column
- Table1.PrintRows();
-
- // now enumerate the data source and print the table body
- while (columnData.HasMoreRows)
- {
- // print the table body
- Table1.PrintColumn(1);
- Table1.PrintRows();
- // go next data source row
- columnData.Next();
- }
- // print the last table column - it is a footer
- Table1.PrintColumn(2);
- Table1.PrintRows();
- }
- }
- }
- </ScriptText>
- <Dictionary>
- <TableDataSource Name="Employees" ReferenceName="NorthWind.Employees" DataType="System.Int32" Enabled="true">
- <Column Name="EmployeeID" DataType="System.Int32"/>
- <Column Name="LastName" DataType="System.String"/>
- <Column Name="FirstName" DataType="System.String"/>
- <Column Name="Title" DataType="System.String"/>
- <Column Name="TitleOfCourtesy" DataType="System.String"/>
- <Column Name="BirthDate" DataType="System.DateTime"/>
- <Column Name="HireDate" DataType="System.DateTime"/>
- <Column Name="Address" DataType="System.String"/>
- <Column Name="City" DataType="System.String"/>
- <Column Name="Region" DataType="System.String"/>
- <Column Name="PostalCode" DataType="System.String"/>
- <Column Name="Country" DataType="System.String"/>
- <Column Name="HomePhone" DataType="System.String"/>
- <Column Name="Extension" DataType="System.String"/>
- <Column Name="Photo" DataType="System.Byte[]" BindableControl="Picture"/>
- <Column Name="Notes" DataType="System.String"/>
- <Column Name="ReportsTo" DataType="System.Int32"/>
- </TableDataSource>
- </Dictionary>
- <ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
- <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8" CanGrow="true">
- <TextObject Name="Text1" Width="718.2" Height="37.8" Text="EMPLOYEES" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 14pt, style=Bold"/>
- </ReportTitleBand>
- <DataBand Name="Data1" Top="39.8" Width="718.2" Height="236.25">
- <TableObject Name="Table1" Left="9.45" Top="18.9" Width="388.23" Height="198.45" Border.Lines="All" Border.Color="LightGray" Border.Width="2" FixedColumns="1" Layout="Wrapped" WrappedGap="18.9" ManualBuildEvent="Table1_ManualBuild">
- <TableColumn Name="Column1" Width="85.05"/>
- <TableColumn Name="Column2" MinWidth="141.75" Width="237.03" AutoSize="true"/>
- <TableColumn Name="Column3"/>
- <TableRow Name="Row1">
- <TableCell Name="Cell1" Border.Lines="All" Border.Color="LightGray" Text="Name" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- <TableCell Name="Cell2" Border.Lines="All" Border.LeftLine.Color="LightGray" Border.LeftLine.Width="2" Border.TopLine.Color="LightGray" Border.RightLine.Color="LightGray" Border.RightLine.Width="2" Border.BottomLine.Color="LightGray" Text="[Employees.FirstName] [Employees.LastName]" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell23" Text="Total: [Count(Cell2)]" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 9pt" RowSpan="4"/>
- </TableRow>
- <TableRow Name="Row2">
- <TableCell Name="Cell6" Border.Lines="All" Border.Color="LightGray" Text="Title" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- <TableCell Name="Cell7" Border.Lines="All" Border.LeftLine.Color="LightGray" Border.LeftLine.Width="2" Border.TopLine.Color="LightGray" Border.RightLine.Color="LightGray" Border.RightLine.Width="2" Border.BottomLine.Color="LightGray" Text="[Employees.Title]" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell24" Font="Segoe UI, 9pt"/>
- </TableRow>
- <TableRow Name="Row3">
- <TableCell Name="Cell11" Border.Lines="All" Border.Color="LightGray" Text="Phone" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- <TableCell Name="Cell12" Border.Lines="All" Border.LeftLine.Color="LightGray" Border.LeftLine.Width="2" Border.TopLine.Color="LightGray" Border.RightLine.Color="LightGray" Border.RightLine.Width="2" Border.BottomLine.Color="LightGray" Text="[Employees.HomePhone]" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell25" Font="Segoe UI, 9pt"/>
- </TableRow>
- <TableRow Name="Row5" Height="141.75">
- <TableCell Name="Cell21" Border.Lines="All" Border.Color="LightGray" Text="Photo" Padding="5, 0, 0, 0" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- <TableCell Name="Cell22" Border.Lines="All" Border.LeftLine.Color="LightGray" Border.LeftLine.Width="2" Border.TopLine.Color="LightGray" Border.RightLine.Color="LightGray" Border.RightLine.Width="2" Border.BottomLine.Color="LightGray" VertAlign="Center" Font="Segoe UI, 9pt">
- <PictureObject Name="Picture1" Left="9.45" Top="9.45" Width="122.85" Height="122.85" DataColumn="Employees.Photo"/>
- </TableCell>
- <TableCell Name="Cell26" Font="Segoe UI, 9pt"/>
- </TableRow>
- </TableObject>
- </DataBand>
- <PageFooterBand Name="PageFooter1" Top="278.05" Width="718.2" Height="28.35" Fill.Color="WhiteSmoke">
- <TextObject Name="Text2" Left="614.25" Width="94.5" Height="28.35" Text="[PageN]" HorzAlign="Right" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TextObject Name="Text12" Left="9.45" Width="217.35" Height="28.35" Cursor="Hand" Hyperlink.Value="https://www.fast-report.com/en/product/fast-report-net/" Text="Generated by FastReport" VertAlign="Center" Font="Segoe UI, 9pt, style=Underline" TextFill.Color="Blue"/>
- </PageFooterBand>
- </ReportPage>
- </Report>
|