In the event of detail:
int i=0;
private void Onbeforeprint (object sender, System.Drawing.Printing.PrintEventArgs e) {
Control the number of bars displayed per page of reports
if (i!=0&&i%8==0)//per page 8 article
{
Detail.pagebreak = DevExpress.XtraReports.UI.PageBreak.BeforeBand;
}
Else
{
Detail.pagebreak = DevExpress.XtraReports.UI.PageBreak.None;
}
i++;
}
In the event of table:
private void Onbeforeprint (object sender, System.Drawing.Printing.PrintEventArgs e) {
Data set "Storagebillmatitem" is replaced
if (i== (System.Data.DataSet) (Xtrareport1.datasource)). tables["Storagebillmatitem"]. Rows.Count)
{
xrtable table = xrtable2;//template Detail Band xrtable
int iheight = table. Rows[table. ROWS.COUNT-1]. Height;
int spacerowcount = 8-(i)%8;
xrtablerow[] Xrrow = new Xrtablerow[spacerowcount];
for (int k=0;k<spacerowcount; k++)
{
XRROW[K] = new Xrtablerow ();
XRROW[K]. size = new size (table. Width, iheight);
XRROW[K]. Location = new Point (table. Location.x, K * iheight);
XRROW[K]. Borders = (DevExpress.XtraPrinting.BorderSide) ((Borderside.left | Borderside.right) | Borderside.top);
XRROW[K]. BorderWidth = 1;
XRROW[K]. bordercolor = table. Rows[table. ROWS.COUNT-1]. bordercolor;
Createcell
Xrtablerow row = table. Rows[table. ROWS.COUNT-1];
Createcellarray (Xrrow[k], row);
}
XrTable2.Rows.AddRange (Xrrow);
}
}
<summary>
Createcell
</summary>
<param name= "Xrrow" >current row</param>
<param name= "Xrrowtemplate" >row template</param>
private void Createcellarray (Xrtablerow xrrow, Xrtablerow xrrowtemplate)
{
int xmargin = 0;
for (int i = 0; i < XrRowTemplate.Cells.Count; i++)
{
Xrtablecell Xrcell = new Xrtablecell ();
Xrcell. BorderWidth = 1;
Xrcell. Borders = (DevExpress.XtraPrinting.BorderSide) ((Borderside.left | Borderside.right) | Borderside.top);
Xrcell. Width = Xrrowtemplate.cells[i]. Width;
Xrcell. BackColor = Xrrowtemplate.cells[i]. BackColor;
Xrcell. Height = Xrrowtemplate.height;
if (i! = 0)
{
Xrcell. Location = new Point (Convert.ToInt32 (Xmargin + xrrowtemplate.cells[i). Width), 0);
}
Else
{
Xrcell. Location = new Point (0, 0);
}
XRROW.CELLS.ADD (Xrcell);
}
}
Http://www.dxper.net/documents/html/DevExpressXtraReportsUIXtraReport_ScriptLanguagetopic.htm
Xtrareport implementing the specified number of records and filling blank lines