【发布时间】:2017-12-14 23:00:48
【问题描述】:
我需要创建与图像中显示的这种报告格式完全相同的报告格式。 有没有关于如何创建这种报告的教程? 我的报告需要 11 行 x 4 列。所以最多是 44 个数据在 1 页中。
现在我的报告生成 44 页而不是 1 页。
这是我的代码:
if (rptModel.Details.FirstOrDefault() != null)
{
foreach (var item in rptModel.Details)
{
var rpt = new ProductLabelReport();
rpt.DataSource = rptModel;
rpt.ReportParameters["Location"].Value = string.IsNullOrEmpty(item.Location) ? string.Empty : item.Location;
rpt.ReportParameters["Part"].Value = string.IsNullOrEmpty(item.SKU) ? string.Empty : item.SKU;
rpt.ReportParameters["CartonID"].Value = string.IsNullOrEmpty(item.CartonID) ? string.Empty : item.CartonID;
string[] formats = { "dd/MM/yyyy hh:mm:ss tt", "dd/MM/yyyy hh:mm:ss", "d/M/yyyy hh:mm:ss tt", "d/M/yyyy h:mm:ss tt" };
DateTime expectedDate;
if (DateTime.TryParseExact(item.ActDate, formats, new System.Globalization.CultureInfo("en-US"),
System.Globalization.DateTimeStyles.None, out expectedDate))
{
rpt.ReportParameters["StockIn"].Value = expectedDate.ToString("dd/MM/yyyy");
}
else
{
rpt.ReportParameters["StockIn"].Value = "";
}
rptBook.Reports.Add(rpt);
}
}
RptDoc = rptBook;
我正在使用 Telerik Reporting Q2 2015 - 9.1.15.624 和 WPF Visual Studio 2015。
请帮忙。
【问题讨论】: