2016-06-02 3 views
0

Xtrareportに問題があります。私はDataTableから報告するためにデータをバインドしようとしています。しかし、結果は空白です。Xtrareportデータセットのデータをデバックスする

  1. 私はデザイン で、私はこれが

    012私のレポートでデータ

DataTable dt = BDMVanBanDen.SelectAll(); 
      var report = new rptVanBanDen(); 
      report.DataSource = dt; 
      documentViewerReport.Report = report; 
      documentViewerReport.DataBind(); 

をバインドしよう

  • コードをDocumentViewerのを持っています

    と結果は:

    enter image description here

    だから、それはなぜですか?

    あなたのようなあなたのXRTableCellの結合を定義する必要があり、あなたの親密な関係で
  • 答えて

    0

    :今、あなたのrepportを呼び出すことができます

    public partial class rptVanBanDen: DevExpress.XtraReports.UI.XtraReport 
        { 
        public rptVanBanDen(DataTable dt) 
         { 
         InitializeComponent(); 
         //*********you must repeat this block for each  `XRTableCell` 
         XRBinding binding = new XRBinding(); 
         binding = new XRBinding("Text", dt,dt.Columns["NgayDen"].ColumnName); 
         NgayDen.DataBindings.Add(binding); //"NgayDen" here isName of your XRTableCell 
          //*********************** 
         } 
        } 
    

    DataTable dt = BDMVanBanDen.SelectAll(); 
        rptVanBanDenreport = new rptVanBanDen(dt); 
        documentViewerReport.Report = report; 
        documentViewerReport.DataBind(); 
    
    関連する問題