This article from: http://www.cnblogs.com/msdn/archive/2009/06/26/1511764.html
Company in FastReport. net version is coming out soon, let us learn, because the company's software requires the use of this tool, some of which require the data area to display N pieces of data per line, I will not, ah, I asked the experts and came to the conclusion that FastReport could not be achieved. At that time, I thought so, because they were experts. Therefore, any program that has similar requirements can only be processed as a field in the cs code. concatenate a string and wrap the line in the middle of the carriage return.
Today, I had a hard time idle. I thought about whether it could be implemented. So I started to do it. Oh, I finally realized it. The code may be simple, but I was born out of nothing, happy to say.
1. First, pull a Table control from the toolbar, place the data to be displayed in the corresponding cell, and set the Table1 control attribute LayOut to Wrapped.
2. Generate events
Code
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 tablew.beforeprint (object sender, EventArgs e)
{
// Get the data source by its name
Performancebase columnData = Report. GetDataSource ("Employees ");
// Init the data source
ColumnData. Init ();
While (columnData. HasMoreRows)
{
If (columnData. CurrentRowNo) % 2 = 0)
{
Table1.PageBreak ();
}
// Print the table body
Table1.PrintColumn (0 );
Table1.PrintRows ();
// Go next data source row
ColumnData. Next ();
}
}
}
}