【发布时间】:2017-01-04 22:12:14
【问题描述】:
在一个遗留项目中,我们使用旧版本的 Telerik 报告(2013 年第三季度),我们在其中创建 PDF 报告。我们有一个主/子报表,其中一个子报表内容添加到代码中。当有足够的项目需要它在下一页上呈现时,我们可以看到 page2 上的第二个项目呈现在第一个项目的顶部。即使我添加一个面板而不是我们的自定义控件,我也会得到相同的行为。使用的报告仅包含一个面板项,其中将 keeptogether 设置为 true。
private void ContractualInformationChartItemDataBinding(object sender, EventArgs eventArgs)
{
panel.Items.Clear();
panel.Width = Unit.Inch(4.82);
var week = int.Parse(ReportParameters["Week"].Value.ToString());
var year = int.Parse(ReportParameters["Year"].Value.ToString());
var regionId = int.Parse(ReportParameters["RegionId"].Value.ToString());
using (var provider = new Provider())
{
var report =
new TimeReportService().GetOrCreateWeeklyReport(week, year, provider)
.WeeklyRegionReports.First(wr => wr.RegionId == regionId && wr.DeletedBy == null && wr.DeletedDate == null);
if (report.ContractualInformations != null && report.ContractualInformations.Any())
{
foreach (var rig in report.ContractualInformations.Where(r => r.DeletedBy == null && r.DeletedDate == null).Select(zt => zt.Rig).Distinct())
{
//The code for the chart can be replaced with a new panel with yellow background and the issue is still the same
var budget = new ContractualInformationService().GetContractualInformation(report.WeeklyReport.Week, report.WeeklyReport.Year, rig.Id, ContractualInformationType.Budget, provider);
var forecast = new ContractualInformationService().GetContractualInformation(report.WeeklyReport.Week, report.WeeklyReport.Year, rig.Id, ContractualInformationType.Forecast, provider);
var chart = new ContractualInformationChart(budget, forecast)
{
Docking = DockingStyle.Top,
Height = Unit.Inch(1.35),
Width = panel.Width,
};
chart.Style.Padding.Bottom = Unit.Inch(0.05);
panel.Items.Add(chart);
}
}
}
}
}
【问题讨论】:
-
您有任何屏幕截图、代码或配置说明吗?