rdlc报表打印出来没有内容,求助!

zihaobiao2 2012-04-17 04:59:05
我在winform制作了一个名为PredictOrderReport.rdlc的报表(其中的字段来自数据集DateSetPredictOrderReport),并使用了ReportView把这个报表添加进去了(这里显示的数据集是DateSetPredictOrderReport)。现在在ReportView的代码中如下面所写,可打印出来的报表除了固定下来的内容外全是空的(固定的内容也很模糊看不清,不知道什么原因)。请高手帮忙解释下,代码如下:
PredictOrderReportView_Load(object sender, EventArgs e)
{
this.reportViewer1.RefreshReport();
}
public partial class PredictOrderReportView : Form
{
private DataTable dtPredictOrderReports;
public PredictOrderReportView(DataTable dtShipmentReport)
{
InitializeComponent();
this.dtPredictOrderReports = dtShipmentReport;
LocalReport localReport = this.reportViewer1.LocalReport;
localReport.Refresh();
localReport.ReportEmbeddedResource = "Leis.View.Operation.HawbDeparture.PredictOrderReport.rdlc";
localReport.DataSources.Add(new ReportDataSource("PredictOrderReport", dtPredictOrderReports));//这里的PredictOrderReport是报表所在的程序名称,不知道是不是写这个还是得写数据集DateSetPredictOrderReport;dtPredictOrderReports是有数据内容的,将他作为数据源给这个报表。这些疑问还请高手们帮忙解释下,谢谢了!
localReport.Refresh();
PrintLable(localReport);
}
public void PrintLable(LocalReport lreport)
{
if (lreport == null) return;

ReportPrint reportPrint = new ReportPrint(lreport);
PrintController printController = new StandardPrintController();

reportPrint.PrintController = printController;
reportPrint.PageHeight = 90;
reportPrint.PageWidth = 110;
reportPrint.MarginLeft = 0.2;
try
{
reportPrint.Print();
}
catch (Exception e)
{
throw (e);
}

}
...全文
78 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zihaobiao2 2012-04-18
  • 打赏
  • 举报
回复
没人知道嘛!自己先顶下!

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧