首页 新闻 会员 周边

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

0
悬赏园豆:20 [已解决问题] 解决于 2013-03-25 14:10

我在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);
  }

  }

zihaobiao的主页 zihaobiao | 初学一级 | 园豆:200
提问于:2012-04-17 17:17
< >
分享
最佳答案
0

dtPredictOrderReports这个是空的

收获园豆:20
Inspirationss | 菜鸟二级 |园豆:224 | 2012-09-10 16:02
其他回答(1)
0

自己解决了!

zihaobiao | 园豆:200 (初学一级) | 2012-06-20 18:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册