当前位置: 首页>>代码示例>>C#>>正文


C# StiReport.RegBusinessObject方法代码示例

本文整理汇总了C#中StiReport.RegBusinessObject方法的典型用法代码示例。如果您正苦于以下问题:C# StiReport.RegBusinessObject方法的具体用法?C# StiReport.RegBusinessObject怎么用?C# StiReport.RegBusinessObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StiReport的用法示例。


在下文中一共展示了StiReport.RegBusinessObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StiReport

 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public virtual ActionResult StiReport()
 {
     using (var db = new Models.DBContext())
     {
         var obj = db.Provinces.Select(z => new {ProvinceName = z.Name, Citys= z.Citys}).ToList();
         var mainReport = new StiReport();
         mainReport.Load(Server.MapPath("~/Files/Report.mrt"));
         mainReport.Compile();
         mainReport["DateTimeNow"] = DateTime.UtcNow;
         mainReport.RegBusinessObject("ProvincesWithCitys", obj);
         return Stimulsoft.Report.Mvc.StiMvcViewer.GetReportSnapshotResult(HttpContext, mainReport);
     }
 }
开发者ID:omidnasri,项目名称:Stimulsoft-In-ASP.Net-MVC,代码行数:17,代码来源:HomeController.cs

示例2: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     var name = Request["report"];
     if (string.IsNullOrWhiteSpace(name)) return;
     var report = new StiReport();
     report.Load(Server.MapPath("reports") +"\\"+ name + ".mrt");
     var data = new object();
     switch (name)
     {
         case "operInfo":
             {
                 var id = Convert.ToInt32(Request["MeasuresetId"]);
                 data = rds.GetOperInfoReport(id);
             }
             break;
         case "agreement":
             {
                 var id = Convert.ToInt32(Request["id"]);
                 data = rds.Agreement(id);
             }
             break;
         case "dossiersByDistrict":
             {
                 var year = Convert.ToInt32(Request["year"]);
                 var district = Convert.ToInt32(Request["district"]);
                 data = rds.DossiersByDistrictReport(year, district);
                 report.RegBusinessObject("v", new { Name = rds.GetDistrictName(district) });
             }
             break;
         case "crossDistrictMeasure":
             {
                 var measuresetId = Convert.ToInt32(Request["measuresetId"]);
                 var date = Convert.ToDateTime(Request["date"]);
                 data = rds.CrossDistrictMeasure(date, measuresetId);
                 report.RegBusinessObject("opt", new { Data = date });
             }
             break;
         case "crossDistrictMeasureAmountPayed":
             {
                 var measuresetId = Convert.ToInt32(Request["measuresetId"]);
                 var date = Convert.ToDateTime(Request["date"]);
                 data = rds.CrossDistrictMeasureAmountPayed(date, measuresetId);
                 report.RegBusinessObject("opt", new { Data = date });
             }
             break;
         case "contract":
             {
                 var id = Convert.ToInt32(Request["id"]);
                 data = rds.Contract(id);
             }
             break;
         case "auth":
             {
                 var fpiId = Convert.ToInt32(Request["fpiId"]);
                 data = competitorRepo.GetWhere(new { fpiId, StateId = DossierStates.Authorized, Disqualified = false }).ToList();
             }
             break;
         case "losers":
             {
                 var fpiId = Convert.ToInt32(Request["fpiId"]);
                 data = competitorRepo.Losers(fpiId).OrderByDescending(o => o.Value);
             }
             break;
     }
     report.RegData("o", data);
     StiWebViewerFx1.Report = report;
 }
开发者ID:rodrigogalhardo,项目名称:asms-md,代码行数:68,代码来源:Repor.aspx.cs


注:本文中的StiReport.RegBusinessObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。