/// <summary> /// 创建报表文件格式 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public int Create(ReportsEntity entity, List <ReportParamsEntity> list) { if (!entity.ReportNum.IsEmpty()) { return(Update(entity, list)); } int line = 0; using (TransactionScope ts = new TransactionScope()) { entity.ReportNum = entity.ReportNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportsEntity)) : entity.ReportNum; entity.IncludeAll(); line += this.Reports.Add(entity); if (!list.IsNullOrEmpty()) { foreach (ReportParamsEntity item in list) { item.ParamNum = item.ParamNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportParamsEntity)) : item.ParamNum; item.ReportNum = entity.ReportNum; item.IncludeAll(); } this.ReportParams.Add(list); } ts.Complete(); } return(line); }
public void SetUpDashboardTestFixture(ReportsEntity reportData = null) { this.actions.ClearStorage(); try { this.OpenMiDashboardOnce(); } catch { Logger.Log("Second try to log in into application"); Navigate.ToMiDashboard(); this.OpenMiDashboardOnce(); } this.DataLoadStatusConfig(); TestRetryCounter.SetCurrentTestNameAndCounter(); Logger.Log(TestContext.CurrentContext.Test.ClassName); Logger.Log(TestContext.CurrentContext.Test.MethodName); TestRetryCounter.PrintRetryCounter(); if (reportData != null) { Logger.Log($"Report Code: {reportData.Code}"); Logger.Log($"Organization Unit: {reportData.PoV.OrganizationUnit}"); Logger.Log($"Business Group: {reportData.PoV.BusinessGroup}"); Logger.Log($"Business Function: {reportData.PoV.BusinessFunction}"); } this.actions.OpenReportsPage(); Wait.FromSeconds(1); }
public ActionResult Edit() { string ReportNum = WebUtil.GetQueryStringValue <string>("ReportNum", string.Empty); Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] = null; if (ReportNum.IsEmpty()) { return(Redirect("/Report/Manager/List")); } ReportProvider provider = new ReportProvider(); ReportsEntity entity = provider.GetReport(ReportNum); if (entity.IsNull()) { return(Redirect("/Report/Manager/List")); } ViewBag.Entity = entity; ViewBag.ReportType = EnumHelper.GetOptions <EReportType>(entity.ReportType); ViewBag.DataSourceType = EnumHelper.GetOptions <EDataSourceType>(entity.DsType); List <ReportParamsEntity> list = provider.GetParams(ReportNum); if (!list.IsNullOrEmpty()) { Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] = list; } return(View()); }
public ActionResult GetList() { int status = WebUtil.GetFormValue <int>("Status", 0); int ReportType = WebUtil.GetFormValue <int>("ReportType", -1); string ReportName = WebUtil.GetFormValue <string>("ReportName", string.Empty); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; ReportsEntity entity = new ReportsEntity(); ReportProvider provider = new ReportProvider(); if (status > -1) { entity.Where(a => a.Status == status); } if (!ReportName.IsEmpty()) { entity.Where("ReportName", ECondition.Like, "%" + ReportName + "%"); } if (ReportType > 0) { entity.Where(a => a.ReportType == ReportType); } List <ReportsEntity> listResult = provider.GetList(entity, ref pageInfo); listResult = listResult == null ? new List <ReportsEntity>() : listResult; string json = JsonConvert.SerializeObject(listResult); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ReportsPage HeaderWithoutAnyCustomizationOption(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Verify.Title(reportData.Title); this.Verify.OrganizationUnit(reportData.PoV.OrganizationUnit); Assert.IsFalse(this.SingleVtButton.IsVisible()); Assert.IsFalse(this.SingleTimeView.IsVisible()); Assert.IsFalse(this.CurrencyLabel.IsVisible()); Assert.IsFalse(this.CurrentlyManagedCifsButton.IsVisible()); Assert.IsFalse(this.PreviouslyManagedCifsButton.IsVisible()); if (reportData.ThirteenMonths) { this.ThirteenMonthsButton.IsVisible(); } else { Assert.IsFalse(this.ThirteenMonthsButton.IsVisible()); } Assert.IsFalse(this.FiltersButton.IsVisible()); Assert.IsTrue(this.ReloadButton.IsVisible()); Assert.IsTrue(this.ExcelButton.IsVisible()); Assert.IsTrue(this.PdfButton.IsVisible()); Assert.IsTrue(this.SaveButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
public void Test([Values(null)] ReportsEntity report) { this.SetUp(ref report, this.randomReport); var date = ReportsMotherShip.DataLoadStatus.MyContributionRmIcTeam; List <string> months = new List <string> { date.AddMonths(-1).ToString("MMM yy", CultureInfo.GetCultureInfo("en-us")), date.ToString("MMM yy", CultureInfo.GetCultureInfo("en-us")), $"{date.ToString("MMM yy", CultureInfo.GetCultureInfo("en-us"))} YTD", }; this.Report .Verify.TimeViewsOnReport(months); this.Header .ClickCustomizeTheReportButton() .ClickTimePeriods() .VerifyDefaultView() .VerifyTimeViewsOnAppliedValues(months) .ClickYtdButton() .ClickCancelButton(); this.Pov.ChangeDateTo(RandomData.Date()); this.Pov.ChangeDateTo(RandomData.Date(date.AddMonths(-12), date)); this.Header .ClickCustomizeTheReportButton() .ClickTimePeriods() .AddAtLeastOneTimePeriodFromMonthlyView(ref months) .VerifyTimeViewsOnAppliedValues(months) .ClickYtdButton() .VerifyTimeViewsOnCalendar(months) .ClickSubmitButton(); }
public ActionResult Add() { Session[SessionKey.SESSION_REPORT_DETAIL] = null; string SnNum = WebUtil.GetQueryStringValue <string>("SnNum"); ITopClient client = new TopClientDefault(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CompanyID", this.CompanyID); dic.Add("SnNum", SnNum); string result = client.Execute(ReportApiName.ReportApiName_GetSingle, dic); DataResult <ReportsEntity> dataResult = JsonConvert.DeserializeObject <DataResult <ReportsEntity> >(result); ReportsEntity entity = dataResult.Result; entity = entity.IsNull() ? new ReportsEntity() : entity; ViewBag.Entity = entity; ViewBag.ReportType = EnumHelper.GetOptions <EReportType>(entity.ReportType); ViewBag.DataSourceType = EnumHelper.GetOptions <EDataSourceType>(entity.DsType); result = client.Execute(ReportApiName.ReportApiName_GetParameter, dic); DataResult <List <ReportParamsEntity> > paramResult = JsonConvert.DeserializeObject <DataResult <List <ReportParamsEntity> > >(result); List <ReportParamsEntity> listParams = paramResult.Result; Session[SessionKey.SESSION_REPORT_DETAIL] = listParams; return(View()); }
/// <summary> /// 保存设计报表 /// </summary> /// <param name="reportID"></param> /// <param name="reportUUID"></param> /// <returns></returns> public ActionResult SaveDesignedReport(string reportID, string reportUUID) { ITopClient client = new TopClientDefault(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CompanyID", this.CompanyID); dic.Add("SnNum", reportID); if (reportID.IsEmpty()) { return(Redirect("/Report/Manager/List")); } string result = client.Execute(ReportApiName.ReportApiName_GetSingle, dic); DataResult <ReportsEntity> dataResult = JsonConvert.DeserializeObject <DataResult <ReportsEntity> >(result); ReportsEntity entity = dataResult.Result; if (entity.IsNull()) { return(Redirect("/Report/Manager/List")); } string FileRealPath = Server.MapPath("~" + entity.FileName); string FileTempPath = Server.MapPath("~/Theme/content/report/temp/" + reportUUID); FileManager.DeleteFile(FileRealPath); System.IO.File.Copy(FileTempPath, FileRealPath, true); return(Content("")); }
/// <summary> /// 创建报表文件格式 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public int Create(ReportsEntity entity, List <ReportParamsEntity> list) { if (!entity.SnNum.IsEmpty()) { return(Update(entity, list)); } int line = 0; using (TransactionScope ts = new TransactionScope()) { entity.IsDelete = (int)EBool.No; entity.SnNum = ConvertHelper.NewGuid(); entity.ReportNum = entity.ReportNum.IsEmpty() ? new SequenceProvider(this.CompanyID).GetSequence(typeof(ReportsEntity)) : entity.ReportNum; entity.IncludeAll(); line += this.Reports.Add(entity); if (!list.IsNullOrEmpty()) { foreach (ReportParamsEntity item in list) { item.ParamNum = item.ParamNum.IsEmpty() ? new SequenceProvider(this.CompanyID).GetSequence(typeof(ReportParamsEntity)) : item.ParamNum; item.ReportNum = entity.ReportNum; item.ReprtSnNum = entity.SnNum; item.CompanyID = this.CompanyID; item.IncludeAll(); } this.ReportParams.Add(list); } ts.Complete(); } return(line); }
/// <summary> /// 修改报表格式 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public int Update(ReportsEntity entity, List <ReportParamsEntity> list) { int line = 0; using (TransactionScope ts = new TransactionScope()) { ReportParamsEntity param = new ReportParamsEntity(); param.Where(a => a.ReportNum == entity.ReportNum); line += this.ReportParams.Delete(param); entity.Include(a => new { a.ReportName, a.ReportType, a.Remark, a.DataSource, a.DsType, a.FileName }); entity.Where(a => a.ReportNum == entity.ReportNum); line += this.Reports.Update(entity); if (!list.IsNullOrEmpty()) { foreach (ReportParamsEntity item in list) { item.ParamNum = item.ParamNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportParamsEntity)) : item.ParamNum; item.ReportNum = entity.ReportNum; item.IncludeAll(); } this.ReportParams.Add(list); } ts.Complete(); } return(line); }
private ShareFileClient() { Apps = new AppsEntity(this); Favorites = new FavoritesEntity(this); WebhookClients = new WebhookClientsEntity(this); WebhookSubscriptions = new WebhookSubscriptionsEntity(this); Workflows = new WorkflowsEntity(this); Policies = new PoliciesEntity(this); ConnectorGroups = new ConnectorGroupsEntity(this); EncryptedEmails = new EncryptedEmailsEntity(this); FileLock = new FileLockEntity(this); RemoteUploads = new RemoteUploadsEntity(this); Reports = new ReportsEntity(this); FolderTemplates = new FolderTemplatesEntity(this); AccessControls = new AccessControlsEntity(this); Accounts = new AccountsEntity(this); AsyncOperations = new AsyncOperationsEntity(this); Capabilities = new CapabilitiesEntity(this); Devices = new DevicesEntity(this); FavoriteFolders = new FavoriteFoldersEntity(this); Groups = new GroupsEntity(this); Items = new ItemsEntity(this); Metadata = new MetadataEntity(this); Sessions = new SessionsEntity(this); Shares = new SharesEntity(this); StorageCenters = new StorageCentersEntity(this); Users = new UsersEntity(this); Zones = new ZonesEntity(this); SamlMetadata = new SamlMetadataEntity(this); }
/// <summary> /// 报表查询分页 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List <ReportsEntity> GetList(ReportsEntity entity, ref PageInfo pageInfo) { entity.IncludeAll(); entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete); entity.OrderBy(a => a.ID, EOrderBy.ASC); int rowCount = 0; List <ReportsEntity> listResult = this.Reports.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount); pageInfo.RowCount = rowCount; return(listResult); }
/// <summary> /// 根据报表格式编号删除报表 /// </summary> /// <param name="reportNum"></param> /// <returns></returns> public int Delete(string reportNum) { ReportsEntity entity = new ReportsEntity(); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); entity.Where(a => a.ReportNum == reportNum); int line = this.Reports.Update(entity); return(line); }
/// <summary> /// 查询报表 /// </summary> /// <param name="argReportNum"></param> /// <returns></returns> public ReportsEntity GetReport(string argReportNum) { ReportsEntity entity = new ReportsEntity(); entity.IncludeAll(); entity.Where(a => a.ReportNum == argReportNum) .And(a => a.IsDelete == (int)EIsDelete.NotDelete) ; entity = this.Reports.GetSingle(entity); return(entity); }
public void SetUpNext(ref ReportsEntity report, ReportsEntity randomReport) { if (report == null) { report = randomReport; } this.MiDashboard .SetPoV(report.PoV) .OpenReportNext(report.Name, report.Cluster); }
/// <summary> /// 获得报表主体 /// </summary> /// <returns></returns> public ActionResult GetSingle() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); string SnNum = WebUtil.GetFormValue <string>("SnNum", string.Empty); ReportProvider provider = new ReportProvider(CompanyID); ReportsEntity entity = provider.GetReport(SnNum); DataResult <ReportsEntity> result = new DataResult <ReportsEntity>(); result.Code = (int)EResponseCode.Success; result.Message = "响应成功"; result.Result = entity; return(Content(JsonHelper.SerializeObject(result))); }
public ReportsPage VerifyFooter(ReportsEntity report, bool isNna = false) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.CheckLeftFooter(report.LeftFooter(isNna)); // this.CheckCentreFooter(); this.CheckRightFooter(report.RightFooter); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
/// <summary> /// 批量删除 /// </summary> /// <param name="list"></param> /// <returns></returns> public int Delete(List <string> list) { if (!list.IsNullOrEmpty()) { ReportsEntity entity = new ReportsEntity(); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); entity.Where("ReportNum", ECondition.In, list.ToArray()); int line = this.Reports.Update(entity); return(line); } return(0); }
public ActionResult Create() { ReportProvider provider = new ReportProvider(); ReportsEntity oldEntity = null; ReportsEntity entity = WebUtil.GetFormObject <ReportsEntity>("entity", null); entity.CreateTime = DateTime.Now; entity.IsDelete = (int)EIsDelete.NotDelete; entity.Status = (int)EBool.No; //是否被禁用 entity.FileName = entity.FileName.IsEmpty() ? "/Theme/content/report/" + Guid.NewGuid().ToString() + ".frx" : entity.FileName; List <ReportParamsEntity> listSource = Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] as List <ReportParamsEntity>; if (!entity.ReportNum.IsEmpty()) { oldEntity = provider.GetReport(entity.ReportNum); } if (oldEntity != null) { if (oldEntity.FileName != entity.FileName) { string FileRealPath = Server.MapPath("~" + oldEntity.FileName); string FileTempPath = Server.MapPath("~" + entity.FileName); FileManager.DeleteFile(FileRealPath); System.IO.File.Copy(FileTempPath, FileRealPath, true); entity.FileName = oldEntity.FileName; } } else { FileItem fileItem = FileManager.GetItemInfo(Server.MapPath("~" + entity.FileName)); string FileRealPath = Server.MapPath("~/Theme/content/report/" + fileItem.Name); string FileTempPath = Server.MapPath("~" + entity.FileName); FileManager.MoveFile(FileTempPath, FileRealPath); entity.FileName = "/Theme/content/report/" + fileItem.Name; } int line = provider.Create(entity, listSource); if (line > 0) { this.ReturnJson.AddProperty("Key", "1000"); this.ReturnJson.AddProperty("Value", "操作成功"); } else { this.ReturnJson.AddProperty("Key", "1001"); this.ReturnJson.AddProperty("Value", "操作失败"); } return(Content(this.ReturnJson.ToString())); }
public ReportsPage ReportHeaderLeft(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Title(reportData.Title); Assert.AreEqual(reportData.PoV.OrganizationUnit, this.OrganizationUnitAndDate.GetText()); this.ReportDate(reportData.Date); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
/// <summary> /// 查询报表分页列表 /// </summary> /// <returns></returns> public ActionResult GetList() { string ReportNum = WebUtil.GetFormValue <string>("ReportNum"); string ReportName = WebUtil.GetFormValue <string>("ReportName"); int ReportType = WebUtil.GetFormValue <int>("ReportType", 0); int DsType = WebUtil.GetFormValue <int>("DsType", 0); int Status = WebUtil.GetFormValue <int>("Status", 0); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int PageSize = WebUtil.GetFormValue <int>("PageSize", 10); ReportsEntity entity = new ReportsEntity(); PageInfo pageInfo = new PageInfo() { PageIndex = PageIndex, PageSize = PageSize }; ReportProvider provider = new ReportProvider(CompanyID); if (ReportNum.IsNotEmpty()) { entity.And("ReportNum", ECondition.Like, "%" + ReportNum + "%"); } if (ReportName.IsNotEmpty()) { entity.And("ReportName", ECondition.Like, "%" + ReportName + "%"); } if (ReportType > 0) { entity.And(a => a.ReportType == ReportType); } if (DsType > 0) { entity.And(a => a.DsType == DsType); } if (Status > 0) { entity.And(a => a.Status == Status); } List <ReportsEntity> listResult = provider.GetList(entity, ref pageInfo); DataListResult <ReportsEntity> dataResult = new DataListResult <ReportsEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = listResult, PageInfo = pageInfo }; return(Content(JsonHelper.SerializeObject(dataResult))); }
public static ReportsEntity CreateReportEntity(string name, string title, string code, PoVEntity pov, string date, string singleTimeView = null, bool thirteenMonths = false) { var report = new ReportsEntity { Name = thirteenMonths == false ? name : $"{name} 13m", Title = thirteenMonths == false ? title : $"{title} 13m", Code = code, PoV = pov, Date = date, SingleTimeView = singleTimeView, ThirteenMonths = thirteenMonths, }; return(report); }
/// <summary> /// 获取数据源 /// </summary> /// <returns></returns> public ActionResult GetDataSource() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); ReportsEntity entity = WebUtil.GetFormObject <ReportsEntity>("Entity"); List <ReportParamsEntity> list = WebUtil.GetFormObject <List <ReportParamsEntity> >("List"); int orderType = WebUtil.GetFormValue <int>("OrderType", (int)EReportType.Report); string orderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); ReportProvider provider = new ReportProvider(CompanyID); DataSet dataSet = provider.GetDataSource(entity, list, orderType, orderNum); DataResult <DataSet> dataResult = new DataResult <DataSet>(); dataResult.Code = (int)EResponseCode.Success; dataResult.Message = "响应成功"; dataResult.Result = dataSet; return(Content(JsonHelper.SerializeObject(dataResult))); }
/// <summary> /// 新增自定义报表 /// </summary> /// <returns></returns> public ActionResult Add() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); ReportsEntity entity = WebUtil.GetFormObject <ReportsEntity>("Entity"); List <ReportParamsEntity> list = WebUtil.GetFormObject <List <ReportParamsEntity> >("List"); ReportProvider provider = new ReportProvider(CompanyID); int line = provider.Create(entity, list); DataResult result = new DataResult(); if (line > 0) { result.Code = (int)EResponseCode.Success; result.Message = "自定义报表新增成功"; } else { result.Code = (int)EResponseCode.Exception; result.Message = "自定义报表新增失败"; } return(Content(JsonHelper.SerializeObject(result))); }
/// <summary> /// 保存报表设计回调函数 /// </summary> /// <param name="reportID"></param> /// <param name="reportUUID"></param> /// <returns></returns> public ActionResult SaveDesignedReport(string reportID, string reportUUID) { ReportProvider provider = new ReportProvider(); if (reportID.IsEmpty()) { return(Redirect("/Report/Manager/List")); } ReportsEntity entity = provider.GetReport(reportID); if (entity.IsNull()) { return(Redirect("/Report/Manager/List")); } string FileRealPath = Server.MapPath("~" + entity.FileName); string FileTempPath = Server.MapPath("~/Theme/content/report/temp/" + reportUUID); FileManager.DeleteFile(FileRealPath); System.IO.File.Copy(FileTempPath, FileRealPath, true); return(Content("")); }
public ReportsPage HeaderWithSingleVTsAndSingleTimeViewAndNoAttributes(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Verify.Title(reportData.Title); this.Verify.OrganizationUnit(reportData.PoV.OrganizationUnit); this.Verify.VtSelection(reportData.Vt); Assert.IsTrue(this.SingleTimeView.IsVisible()); this.Verify.Currency(reportData.Currency); Assert.IsFalse(this.CurrentlyManagedCifsButton.IsVisible()); Assert.IsFalse(this.PreviouslyManagedCifsButton.IsVisible()); Assert.IsFalse(this.FiltersButton.IsVisible()); Assert.IsTrue(this.ReloadButton.IsVisible()); Assert.IsTrue(this.ExcelButton.IsVisible()); Assert.IsTrue(this.PdfButton.IsVisible()); Assert.IsTrue(this.SaveButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
public ReportsPage HeaderProfitabilityTopEams(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Verify.Title(reportData.Title); this.Verify.OrganizationUnit(reportData.PoV.OrganizationUnit); Assert.IsFalse(this.SingleVtButton.IsVisible()); Assert.IsTrue(this.SingleTimeView.IsVisible()); Assert.IsFalse(this.CurrencyLabel.IsVisible()); Assert.IsFalse(this.CurrentlyManagedCifsButton.IsVisible()); Assert.IsFalse(this.PreviouslyManagedCifsButton.IsVisible()); Assert.IsFalse(this.FiltersButton.IsVisible()); Assert.IsTrue(this.ReloadButton.IsVisible()); Assert.IsTrue(this.ExcelButton.IsVisible()); Assert.IsTrue(this.PdfButton.IsVisible()); Assert.IsTrue(this.SaveButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
/// <summary> /// 查询数据集 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public DataSet GetDataSource(ReportsEntity entity, List <ReportParamsEntity> list, int orderType, string orderNum) { DataSet ds = null; if (entity.ReportType == (int)EReportType.Report) { ds = this.Reports.GetDataSource(entity, list); } else { if (orderType == (int)EReportType.InBill) { Bill <InStorageEntity, InStorDetailEntity> bill = new InStorageOrder(this.CompanyID); ds = bill.GetPrint(orderNum); } else if (orderType == (int)EReportType.OutBill) { Bill <OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder(this.CompanyID); ds = bill.GetPrint(orderNum); } else if (orderType == (int)EReportType.User) { AdminProvider provider = new AdminProvider(this.CompanyID); ds = provider.GetPrint(orderNum); } } if (ds != null) { foreach (DataTable table in ds.Tables) { if (table.Rows.Count == 0) { DataRow row = table.NewRow(); table.Rows.Add(row); } } } return(ds); }
/// <summary> /// 查询数据集 /// </summary> /// <param name="entity"></param> /// <param name="list"></param> /// <returns></returns> public DataSet GetDataSource(ReportsEntity entity, List <ReportParamsEntity> list, int orderType, string orderNum) { DataSet ds = null; if (entity.ReportType == (int)EReportType.Report) { ds = this.Reports.GetDataSource(entity, list); } else { if (orderType == (int)EOrder.InOrder) { Bill <InStorageEntity, InStorDetailEntity> bill = new InStorageOrder(); ds = bill.GetPrint(orderNum); } else if (orderType == (int)EOrder.OutOrder) { Bill <OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder(); ds = bill.GetPrint(orderNum); } } return(ds); }
public ActionResult Designer() { string ReportNum = WebUtil.GetQueryStringValue <string>("SnNum", string.Empty); ReportProvider provider = new ReportProvider(); if (ReportNum.IsEmpty()) { return(Redirect("/Report/Manager/List")); } ReportsEntity entity = provider.GetReport(ReportNum); if (entity.IsNull()) { return(Redirect("/Report/Manager/List")); } List <ReportParamsEntity> list = provider.GetParams(ReportNum); WebReport webReport = new WebReport(); webReport.Width = Unit.Percentage(100); webReport.Height = 600; webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black; webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black; webReport.PrintInBrowser = true; webReport.PrintInPdf = true; webReport.ShowExports = true; webReport.ShowPrint = true; webReport.SinglePage = true; DataSet ds = null; int orderType = 0; if (ReportNum == ResourceManager.GetSettingEntity("InOrder_Template").Value) { orderType = (int)EOrder.InOrder; } else if (ReportNum == ResourceManager.GetSettingEntity("OutOrder_Template").Value) { orderType = (int)EOrder.OutOrder; } ds = new ReportProvider().GetDataSource(entity, list, orderType, ""); string path = Server.MapPath("~" + entity.FileName); if (!FileManager.FileExists(path)) { string template = Server.MapPath("~/Theme/content/report/temp/Report.frx"); System.IO.File.Copy(template, path, true); } webReport.Report.Load(path); if (ds != null && ds.Tables != null && ds.Tables.Count > 0) { webReport.Report.RegisterData(ds); for (int i = 0; i < ds.Tables.Count; i++) { webReport.Report.GetDataSource(ds.Tables[i].TableName).Enabled = true; } } webReport.DesignerPath = "~/WebReportDesigner/index.html"; webReport.DesignReport = true; webReport.DesignScriptCode = true; webReport.DesignerSavePath = "~/Theme/content/report/temp/"; webReport.DesignerSaveCallBack = "~/Report/Manager/SaveDesignedReport"; webReport.ID = ReportNum; ViewBag.WebReport = webReport; return(View()); }