日期:2014-05-17  浏览次数:20452 次

DevExpress XrtaReport 报表的问题?
WEB报表,DevExpress XrtaReport

1:某列多行合并显示怎么搞啊?比如第一列的多行都是同一个部门,那么就合并一下啊

2:个人资料显示的时候,哪怕一页下面有多余的空白,也不能显示其他人的资料,其他人的资料一定要在第二页显示,现在的问题是个人资料连续显示了,也就是一页里可能显示两个人的资料

------解决方案--------------------
public DevExpress.XtraReports.UI.XtraReport

 CreateMasterReport(List<XtraReport> subReports)

 {
XtraReport mainReport = new XtraReport();

List<Subreport> subList = new List<Subreport>();

foreach (XtraReport report in subReports)

{

report.bindingSource1.DataSource = _datas;

report.MasterReport = mainReport;

report.CreateDocument();



Subreport sub = new Subreport();

sub.ReportSource = report;

subList.Add(sub);

}



DevExpress.XtraReports.UI.ReportHeaderBand band = new 
DevExpress.XtraReports.UI.ReportHeaderBand();



//ensure the main report has the same dimension as subreports

mainReport.PaperKind = System.Drawing.Printing.PaperKind.A4;

mainReport.Margins.Left = 64;

mainReport.Margins.Right = 42;

mainReport.Margins.Top = 100;

mainReport.Margins.Bottom = 100;

mainReport.Bands.Add(band);

foreach(Subreport sr in subList)

band.Controls.Add(sr);

mainReport.CreateDocument();

return mainReport;

 }

------解决方案--------------------
public DevExpress.XtraReports.UI.XtraReport

> CreateMasterReport(List subReports)

> {

> XtraReport mainReport = new XtraReport();

> List subList = new List();

> foreach (XtraReport report in subReports)

> {

> report.bindingSource1.DataSource = _datas;

> report.MasterReport = mainReport;

> report.CreateDocument();

> Subreport sub = new Subreport();

> sub.ReportSource = report;

> subList.Add(sub);

> }

> DevExpress.XtraReports.UI.ReportHeaderBand band = new
> DevExpress.XtraReports.UI.ReportHeaderBand();

> //ensure the main report has the same dimension as
> subreports

> mainReport.PaperKind =
> System.Drawing.Printing.PaperKind.A4;

> mainReport.Margins.Left = 64;

> mainReport.Margins.Right = 42;

> mainReport.Margins.Top = 100;

> mainReport.Margins.Bottom = 100;

> mainReport.Bands.Add(band);

> foreach(Subreport sr in subList)

> band.Controls.Add(sr);

> mainReport.CreateDocument();

> return mainReport;

> }