表单设计
WikeFlow2.0演示地址:http://workflow2.wikesoft.com
wikelfow2.0使用的表单设计用的是FastReport。
它一个比较方便的报表工具,支持C/S和B/S。
WikeFlow2.0中审批单用的是FastReport来显示审批单中的业务数据,你可以根据你的实际情况选择用或者不用。
特别声明:FastReport是需要付费的,本项目只提供学习研究使用,如果你的项目中使用未付费或破解版本的FastReport,由此产生的法律风险由你自行承担。
FastReport官网:https://www.fastreportcn.com/。
FastReport设计器设置报表的样式及报表的数据
注册数据
public ActionResult ViewByWorkFlow() { string instanceId = Request["instanceId"]; Instance instance = _workFlowInstanceService.GetInstance(instanceId); HolidayModel data = _holidayService.GetByInstanceId(instanceId); var list = instance.TaskUserRecords.Where(x => x.RunStatus == FlowRunStatusEnum.History).OrderBy(x=>x.DealDate).ToList(); WebReport webReport = new WebReport(); string startPath = Server.MapPath("~"); string formPath = string.Format("{0}FastReport\\holiday.frx",startPath); webReport.Report.Load(formPath); webReport.Report.RegisterData(new List<HolidayModel>() { data },"Holiday"); webReport.Report.RegisterData(new List<Instance>() { instance }, "Instance"); webReport.Report.RegisterData(list, "TaskUserRecord"); webReport.Width = Unit.Percentage(100); webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black; DataBand data1 = webReport.Report.FindObject("Data1") as DataBand; if (data1 != null) { var bindList = webReport.Report.GetDataSource("TaskUserRecord"); bindList.Enabled = true;//必须设置为true,下面的代码设置DataSource才起作用。 data1.DataSource = bindList; } webReport.Height = new Unit(400); ViewBag.WebReport = webReport; return View(); }