示例#1
0
 public ActionResult GetDesignReport()
 {
     try
     {
         if (!string.IsNullOrEmpty(Request.QueryString["DataMethod"]))
         {
             var info = new ReportProvider().GetType().GetMethod(Request.QueryString["DataMethod"]);
             if (info != null)
             {
                 var invoke = info.Invoke(info, string.IsNullOrEmpty(Request.QueryString["DataMethodParamets"]) ? null : new[] { Request.QueryString["DataMethodParamets"] });
                 if (invoke != null)
                 {
                     var report = new StiReport();
                     report.Load((byte[])invoke);
                     return(StiMvcDesigner.GetReportResult(report));
                 }
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
        public string GetPageTitle()
        {
            string title = _titleLabel.Text;

            ReportProvider.LogInfo($"Page title= '{title}'");
            return(title);
        }
示例#3
0
        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());
        }
        protected DataQuery GetDataQuery()
        {
            DataQuery dataQuery = ReportProvider.CreateDataQuery();

            dataQuery.Filters.AddRange(filters);

            string reportClass = GetType().FullName;

            BusinessDomain.ReportQueryStates [reportClass] = dataQuery.Clone();

            if (!AllowOperatorsManage())
            {
                // Filter for the current user if the user cannot manage operators
                DataFilter filter = new DataFilter(DataFilterLogic.ExactMatch, UserField)
                {
                    IsValid     = true,
                    Values      = new object [] { BusinessDomain.LoggedUser.Id },
                    ShowColumns = true
                };

                dataQuery.Filters.Add(filter);
            }

            dataQuery.OrderBy = DataField.OperationTimeStamp;

            return(dataQuery);
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProviderName,TotalProviderExpectedPayInAmount,TotalSlipAmount,MissingSlipAmount")] ReportProvider reportProvider)
        {
            if (id != reportProvider.ProviderTradingProfileID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reportProvider);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReportProviderExists(reportProvider.ProviderTradingProfileID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(reportProvider));
        }
示例#6
0
        public static bool CanChooseDataField(DbField field)
        {
            DataType fieldType = ReportProvider.GetDataFieldType(field);

            switch (field.StrongField)
            {
            case DataField.PartnerName:
            case DataField.PartnersGroupsName:
            case DataField.ItemName:
            case DataField.ItemsGroupName:
            case DataField.LocationName:
            case DataField.SourceLocationName:
            case DataField.TargetLocationName:
            case DataField.LocationsGroupsName:
            case DataField.UserName:
            case DataField.OperationsUserName:
            case DataField.OperationsOperatorName:
            case DataField.UsersGroupsName:
            case DataField.OperationsUsersGroupsName:
            case DataField.OperationsOperatorsGroupsName:
                return(true);

            default:
                return(fieldType == DataType.Date || fieldType == DataType.DateTime);
            }
        }
示例#7
0
        public string GetTextInInput()
        {
            string input = _searchInput.GetAttribute("value");

            ReportProvider.LogInfo($"Input text= '{input}'");
            return(input);
        }
示例#8
0
        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 ReportFilterDateRange(FilterDateRange filter)
            : base(filter)
        {
            foreach (DbField field in filter.FilteredFields)
            {
                DataType type = ReportProvider.GetDataFieldType(field);

                if (type != DataType.Date && type != DataType.DateTime)
                {
                    throw new ArgumentException(string.Format("Filter is used on column of type {0} but is expected to be on a column of type {1}", type, DataType.Date));
                }
            }

            dateRanges = new List <KeyValuePair <FilterDateRange.DateRanges, string> >
            {
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.Custom, Translator.GetString("Custom Dates")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.Today, Translator.GetString("Today")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.Yesterday, Translator.GetString("Yesterday")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.ThisWeek, Translator.GetString("This Week")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.PastWeek, Translator.GetString("Past Week")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.LastWeek, Translator.GetString("Last Week")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.ThisMonth, Translator.GetString("This Month")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.PastMonth, Translator.GetString("Past Month")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.LastMonth, Translator.GetString("Last Month")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.ThisYear, Translator.GetString("This Year")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.PastYear, Translator.GetString("Past Year")),
                new KeyValuePair <FilterDateRange.DateRanges, string> (FilterDateRange.DateRanges.LastYear, Translator.GetString("Last Year"))
            };

            InitializeWidgets();

            ColumnVisible = base.filter.ColumnVisible;
        }
        public static void TearDown()
        {
            string testResultStatus = TestContext.CurrentContext.Result.Outcome.Status.ToString();
            string resultMessage    = TestContext.CurrentContext.Result.Message;

            ReportProvider.GenerateHtmlReport(testResultStatus, resultMessage);
            ReportProvider.LogTestFinished();
            WebDriverProvider.QuitWebDriver();
        }
示例#11
0
        protected override object MainProcess()
        {
            var result = ReportProvider.Search(Query);
            var items  = result.Items.OfType <IReport>().Where(_ => Roles.IsInRole(User.Identity, _.Role)).ToArray();

            result.TypedItems = null;
            result.Items      = items;
            return(result.stringify(Mode));
        }
示例#12
0
        public void DoExportWord()
        {
            string lFileName = ShowExportDialog(RsExportFormat.PortableFormatDocument);

            if (lFileName != null)
            {
                ReportProvider.ReportExporter = new RsRptToWordExporter(ReportProvider);
                ReportProvider.ExportReport(lFileName);
            }
        }
 public static bool CreateDirectory(string dir)
 {
     if (!Directory.Exists(dir))
     {
         Directory.CreateDirectory(dir);
         ReportProvider.LogInfo($"Directory created: {dir}");
         return(true);
     }
     return(false);
 }
示例#14
0
        public void DoExportExcel()
        {
            string lFileName = ShowExportDialog(RsExportFormat.ExcelDocument);

            if (lFileName != null)
            {
                ReportProvider.ReportExporter = new RsRptToExcelExporter(ReportProvider);
                ReportProvider.ExportReport(lFileName);
            }
        }
示例#15
0
        private static string GetFieldText(DbField field, object value)
        {
            if (value == null)
            {
                return(string.Empty);
            }

            string ret = value as string;

            return(ret ?? GetFieldText(ReportProvider.GetDataFieldType(field), value));
        }
        public override DataExchangeSet GetExportData(string title)
        {
            DataType [] columnTypes = new DataType [dataQueryResult.Result.Columns.Count];
            for (int i = 0; i < dataQueryResult.Result.Columns.Count; i++)
            {
                DbField field = dataQueryResult.Columns [i].Field;
                columnTypes [i] = ReportProvider.GetDataFieldType(field);
            }

            return(new DataExchangeSet(title, grid.ToDataTable(false), TotalsShown, columnTypes));
        }
示例#17
0
        public void DoExportHTML32()
        {
            string lFileName = ShowExportDialog(RsExportFormat.PortableFormatDocument);

            if (lFileName != null)
            {
                ReportProvider.ReportExporter = new RsRptToHtmlExporter(ReportProvider);
                ((RsRptToHtmlExporter)(ReportProvider.ReportExporter)).HtmlVersion = RsHtmlVersion.Html32;
                ReportProvider.ExportReport(lFileName);
            }
        }
示例#18
0
        public async Task <IActionResult> Create([Bind("Id,ProviderName,TotalProviderExpectedPayInAmount,TotalSlipAmount,MissingSlipAmount")] ReportProvider reportProvider)
        {
            if (ModelState.IsValid)
            {
                _context.Add(reportProvider);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(reportProvider));
        }
示例#19
0
        public ActionResult GetMetadata()
        {
            ReportProvider            provider  = new ReportProvider();
            string                    ProceName = WebUtil.GetFormValue <string>("ProceName", string.Empty);
            List <ReportParamsEntity> list      = provider.GetProceMetadata(ProceName);

            if (!list.IsNullOrEmpty())
            {
                Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] = list;
            }
            return(Content(this.ReturnJson.ToString()));
        }
示例#20
0
 public static DataTable getcheckSaleInvoice(string salesInvoiceId, long financialYearID)
 {
     try
     {
         DataTable i = ReportProvider.getcheckSaleInvoice(salesInvoiceId, financialYearID);
         return(i);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#21
0
 public static DataTable getSaleFerTilizerInvoice(string salesInvoiceId, long financialYearID)
 {
     try
     {
         DataTable i = ReportProvider.getSaleFerTilizerInvoice(salesInvoiceId, financialYearID);
         return(i);
     }
     catch (Exception ae)
     {
         throw ae;
     }
 }
示例#22
0
 public static DataTable getWholeSaleInvoiceByHSNCode(string SaleID, long financialYearID)
 {
     try
     {
         DataTable i = ReportProvider.getWholeSaleInvoiceByHSNCode(SaleID, financialYearID);
         return(i);
     }
     catch (Exception ae)
     {
         throw ae;
     }
 }
示例#23
0
 public static DataTable getPurchaseReturn(string purchaseReutrnInvoiceId, long financialYearId)
 {
     try
     {
         DataTable dt = ReportProvider.getPurchaseReturn(purchaseReutrnInvoiceId, financialYearId);
         return(dt);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#24
0
 public static DataTable getPGROtherInvoice(string SaleID, long financialYearID)
 {
     try
     {
         DataTable dtPGROther = ReportProvider.getPGROtherInvoice(SaleID, financialYearID);
         return(dtPGROther);
     }
     catch (Exception ae)
     {
         throw ae;
     }
 }
示例#25
0
 public static DataTable getServer()
 {
     try
     {
         DataTable i = ReportProvider.getServer();
         return(i);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#26
0
        /// <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)));
        }
示例#27
0
        /// <summary>
        /// 获得存储过程参数
        /// </summary>
        /// <returns></returns>
        public ActionResult GetProcParameter()
        {
            string                    CompanyID            = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            string                    argProceName         = WebUtil.GetFormValue <string>("ProceName", string.Empty);
            ReportProvider            provider             = new ReportProvider(CompanyID);
            List <ReportParamsEntity> listResult           = provider.GetProceMetadata(argProceName);
            DataResult <List <ReportParamsEntity> > result = new DataResult <List <ReportParamsEntity> >();

            result.Code    = (int)EResponseCode.Success;
            result.Message = "响应成功";
            result.Result  = listResult;
            return(Content(JsonHelper.SerializeObject(result)));
        }
示例#28
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()));
        }
示例#29
0
        /// <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)));
        }
示例#30
0
        public async Task  TriggerReportService()
        {
            try
            {
                ReportProvider rp = new ReportProvider(_reportProcessorRunService,
                                                       _reportLogger,
                                                       _subscriptionService,
                                                       _reportProcessor,
                                                       true);

                await rp.CallReportProcessor(new System.Threading.CancellationToken());
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.GetLogText("reportapi_start"));
            }
        }