• <menu id="w2i4a"></menu>
  • 首頁 > 慧問 > 頻道

    xTrareport 交叉報表數(shù)據(jù)域的數(shù)據(jù)沒顯示!

    發(fā)表于2019-05-10 回復(fù):0 查看:2588  |  
    **用vs利用ReportDesigner設(shè)計了個報表,在里面增加了個Pivot Grid,設(shè)定對應(yīng)的列名和綁定數(shù)據(jù)字段對應(yīng)的FieldName名,并手動對Xreport綁定數(shù)據(jù)源。運行后在RowArea數(shù)據(jù)能夠顯示,DataArea域里面的數(shù)據(jù)為0(數(shù)據(jù)源中的數(shù)據(jù)為非0),應(yīng)該怎樣解決呢?** <pre class='brush: csharp'> private void Form1_Load(object sender, EventArgs e) { DataTableCreate(); DataTableDataInit(); XtraReport xr = new XtraReport(); xr.LoadLayout(@"D:\111.repx"); xr.DataSource = this.infoDt; this.documentViewer1.DocumentSource = xr; xr.CreateDocument(); } private void DataTableDataInit() { this.infoDt.Rows.Clear(); for (int i = 0; i < 5; i++) { DataRow dr = this.infoDt.NewRow(); dr[0] = "花園"; dr[1] = "3期"; dr[2] = "3座"; dr[3] = "60"+i.ToString(); dr[4] = new Random().Next(1,100); dr[5] = new Random().Next(1, 100); dr[6] = new Random().Next(1, 100); dr[7] = new Random().Next(1, 100); dr[8] = new Random().Next(1, 100); dr[9] = new Random().Next(1, 100); dr[10] =new Random().Next(1, 100); infoDt.Rows.Add(dr); } for (int i = 0; i < 5; i++) { DataRow dr = this.infoDt.NewRow(); dr[0] = "花園"; dr[1] = "3期"; dr[2] = "4座"; dr[3] = "30" + i.ToString(); dr[4] = new Random().Next(1, 20); dr[5] = new Random().Next(1, 30); dr[6] = new Random().Next(1, 100; dr[7] = new Random().Next(1, 100); dr[8] = new Random().Next(1, 100); dr[9] = new Random().Next(1, 100); dr[10] = new Random().Next(1, 100); infoDt.Rows.Add(dr); } }</pre> 對應(yīng)的repx文件: <pre class='brush: csharp'> // // pivotGridField1 // this.pivotGridField1.Area = DevExpress.XtraPivotGrid.PivotArea.RowArea; this.pivotGridField1.AreaIndex = 0; this.pivotGridField1.Caption = "小區(qū)"; this.pivotGridField1.FieldName = "nodeName01"; this.pivotGridField1.Name = "pivotGridField1"; this.pivotGridField1.SortOrder = DevExpress.XtraPivotGrid.PivotSortOrder.Descending; // // pivotGridField8 // this.pivotGridField8.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea; this.pivotGridField8.AreaIndex = 3; this.pivotGridField8.Caption = "04"; this.pivotGridField8.FieldName = "04"; this.pivotGridField8.Name = "pivotGridField8"; // // pivotGridField7 // this.pivotGridField7.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea; this.pivotGridField7.AreaIndex = 2; this.pivotGridField7.Caption = "03"; this.pivotGridField7.FieldName = "03"; this.pivotGridField7.Name = "pivotGridField7";</pre>
    0個回答

    打破零回復(fù)...

    回復(fù)

    登錄 慧都網(wǎng)發(fā)表評論

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();