本文整理汇总了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);
}
}
示例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;
}