public void Fill(ReportHelper.TableReport report)
            {
                var o        = (BlockModelCompareViewModel)_r;
                var cacheKey = o.ToJson().ComputeHash();

                report.DataSource = CacheHelper.AddToCache <DataSet>(() => { return(_r.ReportResult(o)); }, cacheKey);
                report.Parameters["ParameterModel1Name"].Value            = o.Model1Name;
                report.Parameters["ParameterModel2Name"].Value            = o.Model2Name;
                report.Parameters["ParameterGradeTonnageFieldName"].Value = o.GradeTonnageFieldName;
                report.Parameters["ParameterUserName"].Value = o.ReportExecutedByUserName;
            }
示例#2
0
            public void Fill(ReportHelper.TableReport report)
            {
                var o        = (AssayReportViewModel)_r;
                var cacheKey = string.Format("{0}-{1}", o.ProjectID, o.ReportName);
                var ds       = CacheHelper.AddToCache <DataSet>(() => { return(_r.ReportResult(o)); }, cacheKey, CacheHelper.DefaultTimeout);

                report.DataSource = ds;
                report.Parameters["ParameterProjectID"].Value = o.ProjectID;
                report.Parameters["ParameterUserName"].Value  = o.ReportExecutedByUserName;

                var tr1 = new XRTableRow {
                    Name = "tr1"
                };

                tr1.Cells.AddRange((from k in ds.Tables[0].Columns.Cast <DataColumn>() select new XRTableCell {
                    Name = k.ColumnName, Text = k.ColumnName
                }).ToArray());
                var h = new XRTable {
                    Name = "h", LocationF = new DevExpress.Utils.PointFloat(0F, 0F), SizeF = new System.Drawing.SizeF(600.0000F, 25F), KeepTogether = true
                };

                h.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { tr1 });
                report.Bands["Detail"].Controls.Add(h);

                var tr2 = new XRTableRow {
                    Name = "tr2"
                };

                tr2.Cells.AddRange((from k in ds.Tables[0].Columns.Cast <DataColumn>() select new XRTableCell {
                    Name = string.Format("{0}_data", k.ColumnName), Text = string.Format("[{0}]", k.ColumnName)
                }).ToArray());
                var t = new XRTable {
                    Name = "t", LocationF = new DevExpress.Utils.PointFloat(0F, 0F), SizeF = new System.Drawing.SizeF(600.0000F, 25F), KeepTogether = true
                };

                t.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { tr2 });
                ((DetailReportBand)report.Bands["DetailReport"]).Bands["DetailBand"].Controls.Add(t);
            }