public ActionResult CreateReportStatus(ReportParameters parameters)
 {
     return(GetView(new StatusModel {
         RequestType = RequestTypes.CreateReport,
         Url = GetUrlFromRoot(Url.HttpRouteUrl("CreateReport", new { entity = parameters.Entity, year = parameters.Year, scenario = parameters.Scenario, kindvgo = parameters.KindVgo })),
     }));
 }
Ejemplo n.º 2
0
        public async Task <string> CreateReport(SafeAccessTokenHandle accessToken, ReportParameters parameters)
        {
            var checkResult = await CheckParameters(accessToken, parameters);

            if (!checkResult.HasValue)
            {
                LogAndThrow("Failed to get valid parameter values");
            }
            else if (!checkResult.Value)
            {
                LogAndThrow("Invalid parameter value", true);
            }
            else
            {
                var dataTable = await _storedProceduresLogic.Value.GetReportDataTable(accessToken, parameters);

                if (dataTable == null)
                {
                    LogAndThrow("Failed to get report data");
                }

                var dbSettings = await _dbAccessor.Value.GetSettings(accessToken);

                var templateFilePath = dbSettings.FirstOrDefault(p => p.Name == TemplateFilePathSettingKey)?.Value;
                if (string.IsNullOrEmpty(templateFilePath))
                {
                    LogAndThrow("Template file path not found in settings");
                }
                var tmpFolderPath = dbSettings.FirstOrDefault(p => p.Name == TmpFolderPathSettingKey)?.Value;
                if (string.IsNullOrEmpty(tmpFolderPath))
                {
                    LogAndThrow("Temp folder path not found in settings");
                }

                var newFilePath = Path.Combine(tmpFolderPath, GetOutputFileName(parameters.Entity));
                File.Copy(templateFilePath, newFilePath, true);

                if (File.Exists(newFilePath))
                {
                    try
                    {
                        ProcessDocument(dataTable, newFilePath, parameters);
                        _logger.Value.Info("Report successfully created", LogPrefix);
                    }
                    catch (Exception ex)
                    {
                        _logger.Value.Error("Failed to process document", ex, LogPrefix);
                        throw;
                    }
                }
                else
                {
                    LogAndThrow($"Failed to copy template {templateFilePath} to new location {newFilePath}");
                }

                return(newFilePath);
            }

            return(null);
        }
Ejemplo n.º 3
0
        public decimal GetUnitsWithinWeightRange(ReportParameters para)
        {
            IQueryable <TransactionLog> result = _db.TransactionLogs;

            if (para.Plant != "All")
            {
                result = result.Where(p => p.PlantId == para.Plant);
            }
            if (para.FillingMachine != "All")
            {
                result = result.Where(p => p.MachineName == para.FillingMachine);
            }
            if (para.ProductCode != "All")
            {
                result = result.Where(p => p.ProductCode == para.ProductCode);
            }

            DateTime dateTimeFrom = DateHelper.StartOfDay(para.DateFrom.Date);
            DateTime dateTimeTo   = DateHelper.EndOfDay(para.DateTo.Date);

            result = result.Where(p => (p.TransactionDate >= dateTimeFrom && p.TransactionDate <= dateTimeTo));

            var data = result
                       .Where(p => p.ClientId == para.ClientId && (p.ActualWeight > (p.TargetWeight - (p.LowerLimit / 1000)) && p.ActualWeight < (p.TargetWeight + (p.UpperLimit / 1000))));


            return(data.Count());
        }
Ejemplo n.º 4
0
        public decimal GetUnitsWithinFillTimeLimits(ReportParameters para)
        {
            IQueryable <TransactionLog> result = _db.TransactionLogs;

            if (para.Plant != "All")
            {
                result = result.Where(p => p.PlantId == para.Plant);
            }
            if (para.FillingMachine != "All")
            {
                result = result.Where(p => p.MachineName == para.FillingMachine);
            }
            if (para.ProductCode != "All")
            {
                result = result.Where(p => p.ProductCode == para.ProductCode);
            }

            DateTime dateTimeFrom = DateHelper.StartOfDay(para.DateFrom.Date);
            DateTime dateTimeTo   = DateHelper.EndOfDay(para.DateTo.Date);

            result = result.Where(p => (p.TransactionDate >= dateTimeFrom && p.TransactionDate <= dateTimeTo));

            var data = result
                       .Where(p => p.ClientId == para.ClientId && p.ActualFillTime <= p.ExpectedFillTime);


            return(data.Count());
        }
        /// <summary>
        /// Date:30/11/2016 #2818 Following method is created to load _ViewAllReportGraph partial view(pop-up) for chart
        /// </summary>
        public async Task <PartialViewResult> LoadChartTablePartial(int Id, string DbName, string Container, string[] SDV, bool TopOnly = true, string ViewBy = "Q", string StartDate = "01/01/1900", string EndDate = "01/01/2100", string DisplayName = "", int DashboardId = 0, int DashboardPageid = 0, int DashboardContentId = 0, string Customquery = "", string Charttype = "")
        {
            ReportParameters objReportTable = new ReportParameters();

            objReportTable.Id          = Id;
            objReportTable.DisplayName = DisplayName;
            objReportTable.Container   = Container;
            //SDV is parameter to pass selected filter
            objReportTable.SDV       = SDV;
            objReportTable.TopOnly   = false;
            objReportTable.ViewBy    = ViewBy;
            objReportTable.StartDate = StartDate;
            objReportTable.EndDate   = EndDate;

            objReportTable.DashboardContentId = DashboardContentId;
            objReportTable.HelpTextId         = 0;
            objReportTable.DashboardId        = DashboardId;
            objReportTable.IsSortByValue      = false;
            objReportTable.SortOrder          = "asc";
            objReportTable.DisplayName        = DisplayName;
            objReportTable.CustomQuery        = Customquery;
            objReportTable.ChartType          = Charttype;
            await Task.Delay(1);

            return(PartialView("_ViewAllReportGraph", objReportTable));
        }
Ejemplo n.º 6
0
        public List <rptProductionSummary> GetProductionSummaryReport(ReportParameters para)
        {
            IQueryable <TransactionLog> result = GetFilteredTransactionLog(para);

            var data = result
                       .Where(p => p.ClientId == para.ClientId)
                       .GroupBy(p => new { p.ProductCode, p.ProductName }, (key, group) => new
            {
                ProductCode = key.ProductCode,
                ProductName = key.ProductName,
                Result      = group.ToList()
            })
                       .Select(s => new rptProductionSummary
            {
                ProductCode       = s.ProductCode,
                ProductName       = s.ProductName,
                Units             = s.Result.Count(),
                ProductWeight     = s.Result.Min(p => p.TargetWeight),
                TotalTargetWeight = s.Result.Sum(p => p.TargetWeight),
                TotalActualWeight = s.Result.Sum(p => p.ActualWeight),
                Diff = s.Result.Sum(p => p.ActualWeight) - s.Result.Sum(p => p.TargetWeight),
            }).ToList();

            return(data.ToList());
        }
Ejemplo n.º 7
0
        public List <rptProductionRuntime> GetProductionRunTimeReport(ReportParameters para)
        {
            IQueryable <TransactionLog> result = GetFilteredTransactionLog(para);

            var data = result
                       .Where(p => p.ClientId == para.ClientId)
                       .GroupBy(p => new {
                p.MachineName,
                TransDate = (DateTime)DbFunctions.TruncateTime(p.TransactionDate),
                TransHour = (int)SqlFunctions.DatePart("hour", p.TransactionDate)
            }, (key, group) => new
            {
                MachineName = key.MachineName,
                TransDate   = key.TransDate,
                TransHour   = key.TransHour,
                Result      = group.ToList()
            })
                       .OrderBy(p => p.MachineName).ThenBy(p => p.TransDate).ThenBy(p => p.TransHour)
                       .Select(s => new rptProductionRuntime
            {
                MachineName = s.MachineName,
                TransDate   = s.TransDate,
                TransHour   = s.TransHour,
                TotalUnits  = s.Result.Count()
            }).ToList();

            return(data.ToList());
        }
Ejemplo n.º 8
0
        private void RunStandardReport(string reportName)
        {
            string s = Path.GetFileNameWithoutExtension(reportName);

            if (s == "ContributorsList")
            {
                this.RunContributors(reportName);
            }
            else if (s == "NoConnectionReport")
            {
                this.RunProviderIndependent(reportName);
            }
            else if (s == "EventLog")
            {
                this.RunEventLogger(reportName);
            }
//			this.RunEventLogger_Pdf(reportName);
            else
            {
                ReportParameters parameters = ReportEngine.LoadParameters(reportName);

                if ((parameters != null) && (parameters.SqlParameters.Count > 0))
                {
                    parameters.SqlParameters[0].ParameterValue = "I'm the Parameter";
                }
                this.previewControl1.PreviewLayoutChanged += delegate(object sender, EventArgs e)
                {
                    this.RunStandardReport(reportName);
                };
                this.previewControl1.RunReport(reportName, parameters);
            }
        }
        public IActionResult ReportView([FromForm] string reportParameters)
        {
            ReportParameters reportParms = JsonConvert.DeserializeObject <ReportParameters>(reportParameters);
            ExcelPackage     excel       = new ExcelPackage();

            excel.Workbook.Worksheets.Add(reportParms.ReportName);

            using (var db = new BTAContext())
            {
                var rpt = db.Report.SingleOrDefault(x => x.Name == reportParms.ReportName);
                if (rpt == null)
                {
                    throw new ArgumentException("An invalid report name was passed", "Report Name");
                }
                var rptFactory = new ReportFactory(db);
                var rptHandler = rptFactory.Create(reportParms.ReportName);
                rptHandler.ProcessReport(excel, reportParms, db);
            }
            string fileName    = string.Format("{0}_{1:yyyyMMdd_hhmmss}.xlsx", reportParms.ReportName, DateTime.Now);
            string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            var    mstream     = new MemoryStream();

            excel.SaveAs(mstream);
            Logger.LogDebug("Content Type: {0} | File Name: {1} | File Size: {2}", contentType, fileName, mstream.Length);
            var fsr = new FileStreamResult(mstream, contentType)
            {
                FileDownloadName = fileName
            };

            return(fsr);
        }
Ejemplo n.º 10
0
        private static void AttachDiffs(ReportParameters <RowDifference> rep, SnapshotTableDifferences tableDiffs)
        {
            var allCols = tableDiffs.RowDifferences.Where(r => r.Differences != null).SelectMany(r => r.Differences.Differences.Select(d => d.Name)).Distinct();
            var key     = tableDiffs.RowDifferences.FirstOrDefault()?.Key;

            rep.RemoveBufferLimit();
            rep.Title(tableDiffs.TableDefinition.TableName);

            rep.AddColumn(rd => rd.DifferenceType.ToString(), cc => cc.Heading("Difference"));

            if (key != null)
            {
                var keyIndex = 0;
                foreach (var keyField in key.GetFieldNames())
                {
                    rep.AddColumn(rd => rd.Key.AllKeys.Skip(keyIndex).First(), cc => cc.Heading(keyField));
                }
            }

            foreach (var col in allCols)
            {
                rep.AddColumn(rep.Lambda(rd => rd.Differences?.Differences.FirstOrDefault(fd => fd.Name == col)?.Before), cc => cc.Heading($"{col} before"));
                rep.AddColumn(rep.Lambda(rd => rd.Differences?.Differences.FirstOrDefault(fd => fd.Name == col)?.After), cc => cc.Heading($"{col} after"));
            }
        }
Ejemplo n.º 11
0
        public IActionResult ExecuteReport([FromBody] ReportParameters reportParameters)
        {
            ExcelPackage excel = new ExcelPackage();

            excel.Workbook.Worksheets.Add(reportParameters.ReportName);

            using (var db = new BTAContext())
            {
                var rpt = db.Report.SingleOrDefault(x => x.Name == reportParameters.ReportName);
                if (rpt == null)
                {
                    throw new ArgumentException("An invalid report name was passed", "Report Name");
                }
                var rptFactory = new ReportFactory(db);
                var rptHandler = rptFactory.Create(reportParameters.ReportName);
                rptHandler.ProcessReport(excel, reportParameters, db);
            }

            string fileName = string.Format("{0}_{1:yyyyMMdd_hhmmss}.xlsx", reportParameters.ReportName, DateTime.Now);
            var    mstream  = new MemoryStream();

            excel.SaveAs(mstream);
            return(new FileStreamResult(mstream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
            {
                FileDownloadName = string.Format("{0}_{1:yyyyMMdd_hhmmss}.xlsx", reportParameters.ReportName, DateTime.Now)
            });
        }
Ejemplo n.º 12
0
 public MovementReportMenu(Form tMainForm, int iFactoryID, int iStoreType, ref ReportParameters tReportMenu)
 {
     MainForm   = tMainForm;
     StoreType  = iStoreType;
     FactoryID  = iFactoryID;
     ReportMenu = tReportMenu;
     InitializeComponent();
 }
Ejemplo n.º 13
0
        protected void SalesOrderDetail_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Sales Order Detail.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            ReportParameters.SetReport(rpt);
        }
        public void ByDefaultOmitHeadingsIsFalse()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Assert
            Assert.That(parameters.Details.OmitHeadings, Is.False);
        }
        public void ByDefaultNoColumnsAreDefined()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Assert
            Assert.That(parameters.ColumnSource.Columns, Is.Empty);
        }
Ejemplo n.º 16
0
 public virtual void AddParameter(string name, string value)
 {
     if (ReportParameters == null)
     {
         ReportParameters = new Dictionary <string, string>();
     }
     ReportParameters.Add(name, value);
 }
Ejemplo n.º 17
0
		public void RunReport (string fileName,ReportParameters parameters)
		{
			if (String.IsNullOrEmpty(fileName)) {
				throw new ArgumentNullException("fileName");
			}
			ReportModel model = ReportEngine.LoadReportModel(fileName);
			this.RunReport(model,parameters);
		}
        public void IndentIsZeroByDefault()
        {
            //Act
            var parameters = new ReportParameters<TestRec>();

            //Assert
            Assert.That(parameters.Details.IndentSpaces, Is.EqualTo(0));
        }
Ejemplo n.º 19
0
        public static MvcHtmlString HiddenParameters(this HtmlHelper htmlHelper, ReportParameters parameters)
        {
            if (htmlHelper != null && parameters != null)
            {            
                return htmlHelper.Hidden("Report.Parameters", Json.Encode(parameters.PersistedInfo));
            }

            return MvcHtmlString.Empty;
        }
Ejemplo n.º 20
0
        protected void TerritorySalesDrilldown_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Territory Sales Drilldown.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            rpt.Run();
            ReportParameters.SetReport(null);
            ReportViewer.SetReport(rpt);
        }
Ejemplo n.º 21
0
        public void SetupAsynchron(string fileName, ReportParameters parameters)
        {
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }
            ReportModel m = ReportEngine.LoadReportModel(fileName);

            RunReport(m, parameters);
        }
Ejemplo n.º 22
0
        public void RunReport(string fileName, ReportParameters parameters)
        {
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }
            ReportModel model = ReportEngine.LoadReportModel(fileName);

            this.RunReport(model, parameters);
        }
        private void fillLooseBalesDataTable(SqlConnection sqlConn, DataSet dataSet, ReportParameters reportParameters)
        {
            var query = dbContext.LooseBales.Where(a => a.DT.Date >= reportParameters.DTFrom.Date && a.DT.Date <= reportParameters.DTTo.Date).ToQueryString();

            var sa = new SqlDataAdapter(query.ToString(), sqlConn);

            sa.Fill(dataSet, nameof(dbContext.LooseBales) + "Summary");
            sa.Dispose();
            query = null;
        }
Ejemplo n.º 24
0
        protected void ProductLineSales_Click(object sender, EventArgs e)
        {
            Rdl.Runtime.Product_Line_Sales pls = new Rdl.Runtime.Product_Line_Sales();
            Rdl.Engine.Report rpt = pls.Report;
            //Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            //rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Product Line Sales.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
            //    @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            ReportParameters.SetReport(rpt);
        }
        protected void ctlPreview_Click(object sender, ImageClickEventArgs e)
        {
            ExpenseStatement_Viewer.Visible = true;
            VOExpenseStatementReport vo       = ctlExpenseStatementCriteria.BindCriteria();
            List <ReportParameters>  rptParam = new List <ReportParameters>();

            ReportParameters paramUserName = new ReportParameters();

            paramUserName.Name  = "UserName";
            paramUserName.Value = UserAccount.UserName;
            rptParam.Add(paramUserName);

            ReportParameters paramFromEmpID = new ReportParameters();

            paramFromEmpID.Name  = "FromEmployeeCode";
            paramFromEmpID.Value = vo.FromExployeeCode == null ? "0" : vo.FromExployeeCode;
            rptParam.Add(paramFromEmpID);

            ReportParameters paramToEmpID = new ReportParameters();

            paramToEmpID.Name  = "ToEmployeeCode";
            paramToEmpID.Value = vo.ToEmployeeCode == null ? "0" : vo.ToEmployeeCode;
            rptParam.Add(paramToEmpID);

            ReportParameters paramFromDueDate = new ReportParameters();

            paramFromDueDate.Name  = "FromDueDate";
            paramFromDueDate.Value = vo.FromDueDate == null?DateTime.MinValue.ToString() : UIHelper.ToDateString(vo.FromDueDate);

            rptParam.Add(paramFromDueDate);

            ReportParameters paramToDueDate = new ReportParameters();

            paramToDueDate.Name  = "ToDueDate";
            paramToDueDate.Value = vo.ToDueDate == null?DateTime.MaxValue.ToString() : UIHelper.ToDateString(vo.ToDueDate);

            rptParam.Add(paramToDueDate);

            ReportParameters paramDocState = new ReportParameters();

            paramDocState.Name  = "DocumentStatus";
            paramDocState.Value = string.IsNullOrEmpty(vo.DocumentStatus) ? string.Empty : vo.DocumentStatus;
            rptParam.Add(paramDocState);

            ReportParameters paramShowParam = new ReportParameters();

            paramShowParam.Name  = "ShowParam";
            paramShowParam.Value = string.IsNullOrEmpty(vo.ShowParam) ? string.Empty : vo.ShowParam;
            rptParam.Add(paramShowParam);

            ExpenseStatement_Viewer.InitializeReport();
            ExpenseStatement_Viewer.Parameters = rptParam;
            ExpenseStatement_Viewer.Visible    = true;
            ExpenseStatement_Viewer.ShowReport();
        }
Ejemplo n.º 26
0
        private void FormatRows(ReportParameters <SnapshotRow> tableParams)
        {
            tableParams
            .RemoveBufferLimit()
            .Title(TableDefinition.TableName);

            foreach (var column in TableDefinition.Columns)
            {
                tableParams.AddColumn(r => r.GetField(column.Name), cc => SnapshotColumnFormatter.Format(cc, TableDefinition, column));
            }
        }
Ejemplo n.º 27
0
        public async Task <IEnumerable <Report> > ReportsByOwnerAsync(Guid ownerId, ReportParameters reportParameters)
        {
            var reportList = await this.FindByCondition(r => r.OwnerId.Equals(ownerId))
                             .ToListAsync();

            var reports = reportList.AsQueryable();

            var sortedReports = _sortHelper.ApplySort(reports, reportParameters.OrderBy);

            return(sortedReports);
        }
        public void AddedColumnsAreRecorded()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Act
            parameters.AddColumn(i => i.Integer, c => { });

            //Assert
            Assert.That(parameters.ColumnSource.Columns.Count(), Is.EqualTo(1));
        }
        public void OmitHeadingsSettingIsRecorded()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Act
            parameters.OmitHeadings();

            //Assert
            Assert.That(parameters.Details.OmitHeadings, Is.True);
        }
Ejemplo n.º 30
0
        async Task GetData()
        {
            var selectedCountries       = string.Join <string>(",", Items.Select(i => i.Name));
            ReportParameters parameters = new ReportParameters
            {
                Countries = selectedCountries,
                StartDate = startDate
            };

            ReportData = await _historicalService.GetHistoricalReportByCountriesByDate(parameters);
        }
Ejemplo n.º 31
0
		public void RunReport(ReportModel reportModel, System.Collections.IList dataSource, ReportParameters parameters)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			if (dataSource == null) {
				throw new ArgumentNullException("dataSource");
			}
			ReportEngine.CheckForParameters(reportModel, parameters);
			IDataManager dataManager = DataManagerFactory.CreateDataManager(reportModel, dataSource);
			RunReport(reportModel, dataManager);
		}
Ejemplo n.º 32
0
 public void RunReport(ReportModel reportModel, DataTable dataTable, ReportParameters parameters)
 {
     if (reportModel == null)
     {
         throw new ArgumentNullException("reportModel");
     }
     if (dataTable == null)
     {
         throw new ArgumentNullException("dataTable");
     }
     RunReport(reportModel, DataManagerFactory.CreateDataManager(reportModel, dataTable));
 }
Ejemplo n.º 33
0
        /// <summary>
        /// Prepare report and upload it to current user's OneDrive.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public async Task <IDriveItem> PrepareReportInOneDrive(ITurnContext context, ReportParameters parameters, CancellationToken cancellationToken)
        {
            var messages = await GetMessagesHistoryAsync(context, parameters, cancellationToken);

            var reportBodyDetails = await GetReportBodyDetailsAsync(context, messages, parameters, cancellationToken);

            var reportContent = await GenerateReportByteArray(context, reportBodyDetails, parameters.Format, cancellationToken);

            var onedriveFile = await UploadReportAsync(context, reportBodyDetails, reportContent, parameters.Format, cancellationToken);

            return(onedriveFile);
        }
        /// <summary>
        /// Populate Days in Reportdays Table
        /// </summary>
        /// <param name="rep"></param>
        /// <returns></returns>
        private string getReportDaysQuery(ReportParameters rep)
        {
            var query = $@" 
DECLARE @DTFrom DATETIME; SET @DTFrom = CAST({rep.DTFrom} AS DATE) ;
DECLARE @DTTo DATETIME; SET @DTTo = CAST({rep.DTTo} AS DATE) ;
WITH AllDays AS 
    (SELECT @DTFrom AS ReportDay
        UNION ALL
        SELECT   DATEADD(DAY, 1, ReportDay) FROM AllDays WHERE    ReportDay < @DTTo )
SELECT ReportDay FROM AllDays OPTION (MAXRECURSION 0)";

            return(query);
        }
Ejemplo n.º 35
0
		public void RunReport(ReportModel reportModel, ReportParameters parameters)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			this.SetupViewer(reportModel);
			if (reportModel.DataModel == GlobalEnums.PushPullModel.FormSheet) {
				RunFormSheet(reportModel);
			} else {
				var dataManager = DataManagerFactory.CreateDataManager(reportModel, parameters);
				RunReport(reportModel,dataManager);
			}
		}
Ejemplo n.º 36
0
 public async Task ComboPopulateForClients(ReportParameters p)
 {
     var das = new DataSet();
     await Task.Run(() =>
     {
         connection.MyConnection();
         connection.SqlQuery("Select CustomerName from Sales");
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlDataReader dr       = connection.command.ExecuteReader();
         adapter.SelectCommand  = connection.command;
         adapter.Fill(das);
     });
 }
        public IActionResult ReportDataSet([FromQuery] ReportParameters reportParameters)
        {
            try
            {
                var result = repository.FillReportDataSet(reportParameters);

                return(Accepted(result));
            }
            catch (Exception ex)
            {
                logger.LogError(ex.GetExceptionMessages());
                return(StatusCode(StatusCodes.Status500InternalServerError, Constants.ErrorMessages.UpdateError));
            }
        }
        public void AddedColumnsHaveCorrectType()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Act
            parameters.AddColumn(i => i.Integer, c => { });
            parameters.AddColumn(i => i.Double, c => { });
            parameters.AddColumn(i => i.String, c => { });

            //Assert
            var result = parameters.ColumnSource.Columns.Select(c => c.Type.Name).JoinWith(" ");
            Assert.That(result, Is.EqualTo("Int32 Double String"));
        }
Ejemplo n.º 39
0
        public void SetupAsynchron(ReportModel reportModel, DataTable dataTable, ReportParameters parameters)
        {
            RunReport(reportModel, dataTable, parameters);

            /*
             * if (reportModel == null) {
             *      throw new ArgumentNullException("reportModel");
             * }
             * if (dataTable == null) {
             *      throw new ArgumentNullException("dataTable");
             * }
             * SetupAsynchron (reportModel,DataManagerFactory.CreateDataManager(reportModel,dataTable));
             */
        }
Ejemplo n.º 40
0
        public void SalesTotal(ReportParameters parameters)
        {
            connection.MyConnection();
            connection.SqlQuery("Select Sum(CostPrice) from Product");
            SqlDataReader dr = connection.command.ExecuteReader();

            int count = 0;

            while (dr.Read())
            {
                count++;
            }
            parameters.TotalSales = count.ToString();
        }
Ejemplo n.º 41
0
		public void RunReport(ReportModel reportModel, ReportParameters parameters)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			Pages.Clear();
			if (reportModel.DataModel == GlobalEnums.PushPullModel.FormSheet)
			{
				RunFormSheet(reportModel);
			} else {
				ReportEngine.CheckForParameters(reportModel, parameters);
				var dataManager = DataManagerFactory.CreateDataManager(reportModel, parameters);
				RunReport(reportModel, dataManager);
			}
		}
Ejemplo n.º 42
0
		public void RunReport(ReportModel reportModel, DataTable dataTable, ReportParameters parameters)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			if (dataTable == null) {
				throw new ArgumentNullException("dataTable");
			}
			ReportEngine.CheckForParameters(reportModel, parameters);
			IDataManager dataManager = DataManagerFactory.CreateDataManager(reportModel, dataTable);
			IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, dataManager);
//			reportCreator.SectionRendering += new EventHandler<SectionRenderEventArgs>(PushPrinting);
//			reportCreator.GroupHeaderRendering += new EventHandler<GroupHeaderEventArgs>(GroupHeaderRendering);
//			reportCreator.GroupFooterRendering += GroupFooterRendering;
//
//			reportCreator.RowRendering += new EventHandler<RowRenderEventArgs>(RowRendering);
			reportCreator.BuildExportList();
		}
Ejemplo n.º 43
0
        public void Run(Session session, Topic topic, Discussion discussion, Person person)
        {
            //tests
            //var ctx = new DiscCtx(ConfigManager.ConnStr);
            //var discussion = ctx.Discussion.First();
            //var topic = discussion.Topic.First();
            //var session = ctx.Session.FirstOrDefault();
            //var pers = session.Person.First();

            //start hard report 
            var reportParameters = new ReportParameters(session.Person.Select(p => p.Id).ToList(),
                                                        session, topic, discussion);
            var tcs = new TaskCompletionSource<ReportCollector>();
            new ReportCollector(null, ReportGenerated, reportParameters, tcs, UISharedRTClient.Instance.clienRt);

            var pdfAsm = new Reporter.pdf.PdfAssembler2(discussion, topic, person, session,
                                                        Utils.RandomFilePath(".pdf"), tcs.Task,
                                                        RemoteFinalSceneScreenshot(topic.Id, discussion.Id));

            pdfAsm.RunAsync().GetAwaiter().OnCompleted(() => { });
        }
Ejemplo n.º 44
0
		public void SetupAsynchron (ReportModel reportModel,ReportParameters parameters)
		{
			
			RunReport (reportModel,parameters);
			/*
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			
			this.SetupViewer(reportModel);
			
			if (reportModel.DataModel == GlobalEnums.PushPullModel.FormSheet) {
				RunFormSheet(reportModel);
			} else {
				ReportEngine.CheckForParameters(reportModel,parameters);
				this.dataManager = DataManagerFactory.CreateDataManager(reportModel,parameters);
				RunDataReport (reportModel,dataManager);
			}
			 */
		}
Ejemplo n.º 45
0
		public void SetupAsynchron (ReportModel reportModel,DataTable dataTable,ReportParameters parameters)
		{
			RunReport(reportModel,dataTable,parameters);
			/*
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			if (dataTable == null) {
				throw new ArgumentNullException("dataTable");
			}
			SetupAsynchron (reportModel,DataManagerFactory.CreateDataManager(reportModel,dataTable));
			 */
		}
Ejemplo n.º 46
0
		public void RunReport (ReportModel reportModel,DataTable dataTable,ReportParameters parameters)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			if (dataTable == null) {
				throw new ArgumentNullException("dataTable");
			}
			ReportEngine.CheckForParameters(reportModel,parameters);
			IDataManager dataManager = DataManagerFactory.CreateDataManager(reportModel,dataTable);
			
			RunReport (reportModel,dataManager);
		}
Ejemplo n.º 47
0
		public void SetupAsynchron (string fileName,ReportParameters parameters)
		{
			
			
			if (String.IsNullOrEmpty(fileName)) {
				throw new ArgumentNullException("fileName");
			}
			ReportModel m = ReportEngine.LoadReportModel(fileName);
			RunReport(m,parameters);
		}
        public void SuppressHeadingsSettingIsRecorded()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Act
            parameters.SuppressHeadingRepetition();

            //Assert
            Assert.That(parameters.Details.SuppressHeadingRepetition, Is.True);
        }
        public void RequestedIndentIsRecorded()
        {
            //Arrange
            var parameters = new ReportParameters<TestRec>();

            //Act
            parameters.Indent(4);

            //Assert
            Assert.That(parameters.Details.IndentSpaces, Is.EqualTo(4));
        }