我有一个超过300行的datatable。我希望每页只显示10行。我想强制xtrareport在10行后中断。
你知道这是怎么做的吗?
发布于 2012-03-14 18:30:41
您可以在某些情况下强制分页符。This page在底部有一个示例。
Hi Cary
要完成此任务,您可以添加GroupFooter带并将GroupFooter.PageBreak设置为AfterBand。或放置一个XRPageBreak控件,处理Detail.BeforePrint并根据需要调整XRPageBreak的可见性。要处理行,您需要使用XtraReport.GetCurrentRow()方法。请尝试此解决方案,并让我们知道结果。
谢谢,
Andrew
发布于 2012-03-14 18:39:15
您需要创建一个Repport合并。
下面是一个示例:
private void printInvoicesButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
int[] selection = this.ordersGridView.GetSelectedRows();
XtraReport reportMerge = new XtraReport();
reportMerge.CreateDocument();
IList<XtraReport> reportList = new List<XtraReport>();
// Create a report.
//invoiceReport report = new invoiceReport();
for (int j = 0; j < selection.Length; j++)
{
XtraReport report = new XtraReport();
string filePath = @"Reports/invoiceReport1.repx";
report.LoadLayout(filePath);
InvoiceData invoice = new InvoiceData();
for (int i = 0; i < DataRepository.Orders.Orders.Count; i++)
{
if (
ordersGridView.GetRowCellValue(selection[j], "InvoiceCode").Equals(
DataRepository.Orders.Orders[i].InvoiceCode))
{
BindingSource dataSource = new BindingSource();
invoice = InvoiceData.AdaptFrom(DataRepository.Orders.Orders[i], DataRepository.Orders,
DataRepository.Products.Products,
DataRepository.ProductOptionMaster,
DataRepository.ProductOptionDataSet,
DataRepository.CustomerShippingAddresses,
DataRepository.Customers.UserMaster,
DataRepository.AttributesData.Product_Attributes);
dataSource.Add(invoice);
report.DataSource = dataSource;
//report.ShowPreview();
report.CreateDocument();
}
}
reportList.Add(report);
}
for(int i=0;i<reportList.Count;i++)
{
reportMerge.Pages.AddRange(reportList[i].Pages);
}
// Show the report's preview.
reportMerge.ShowPreviewDialog();
}https://stackoverflow.com/questions/9700059
复制相似问题