string ExtractValueFromSinglePage(ref Variable variable, ISinglePage singlePage, ref string retval)
        {
            if (singlePage.IDataNavigator.CurrentRow > -1)
            {
                try {
                    var dataRow = singlePage.IDataNavigator.GetDataRow;
                    var item    = dataRow.Find(variable.VariableName);

                    if (item != null)
                    {
                        retval = item.Value.ToString();
                    }
                    else
                    {
                        retval = GlobalValues.UnkownFunctionMessage(variable.VariableName);
                        WriteLogmessage(variable);
                    }

                    return(retval);
                } catch (Exception e) {
                    Console.WriteLine("Error in FieldReference.ExtractValueFromSinglePage");
                    Console.WriteLine("IDataNavigator currentrow =  {0} count = {1}", singlePage.IDataNavigator.CurrentRow, singlePage.IDataNavigator.Count);
                    throw e;
                }
            }
            return(variable.VariableName);
        }
Example #2
0
 public static void InitPage(ISinglePage singlePage, ReportSettings reportSettings)
 {
     singlePage.StartRow       = -1;
     singlePage.EndRow         = -1;
     singlePage.ReportFileName = reportSettings.FileName;
     singlePage.ReportName     = reportSettings.ReportName;
     singlePage.ParameterHash  = reportSettings.ParameterCollection.CreateHash();
 }
Example #3
0
        public RenderTable(IDataNavigator datanavigator, Rectangle parentRectangle, ISinglePage singlePage, ILayouter layouter, BaseSection section)
        {
            this.dataNavigator = datanavigator;

            this.parentRectangle = parentRectangle;
            this.singlePage      = singlePage;
            this.layouter        = layouter;
            this.currentSection  = section;
        }
		public static IExpressionEvaluatorFacade  CreateEvaluator (ISinglePage singlePage,IDataNavigator dataNavigator)
		{
			if (singlePage == null) {
				
				throw new ArgumentNullException("singlePage");
			}
			singlePage.IDataNavigator = dataNavigator;
			IExpressionEvaluatorFacade evaluatorFacade = new ExpressionEvaluatorFacade(singlePage);
			return evaluatorFacade;
		}
Example #5
0
		public RenderTable(IDataNavigator datanavigator,Rectangle parentRectangle,ISinglePage singlePage,ILayouter layouter,BaseSection section)
		{
			this.dataNavigator = datanavigator;
			
			this.parentRectangle = parentRectangle;
			this.singlePage = singlePage;
			this.layouter = layouter;
			this.currentSection = section;
	
		}
Example #6
0
        public static IExpressionEvaluatorFacade  CreateEvaluator(ISinglePage singlePage, IDataNavigator dataNavigator)
        {
            if (singlePage == null)
            {
                throw new ArgumentNullException("singlePage");
            }
            singlePage.IDataNavigator = dataNavigator;
            IExpressionEvaluatorFacade evaluatorFacade = new ExpressionEvaluatorFacade(singlePage);

            return(evaluatorFacade);
        }
Example #7
0
        public void Calculate_PageHeader()
        {
            IReportModel model      = ReportModel.Create();
            ISinglePage  singlePage = CreateSinglePage(model, 0);

            singlePage.CalculatePageBounds(model);

            Point expectedLocation = new Point(model.ReportSettings.LeftMargin, model.ReportSettings.TopMargin + singlePage.SectionBounds.ReportHeaderRectangle.Size.Height + 1);

            Assert.That(singlePage.SectionBounds.PageHeaderRectangle.Location, Is.EqualTo(expectedLocation));
        }
		public ReportPageEventArgs(PrintPageEventArgs e,
		                           ISinglePage singlePage,
		                           bool forceNewPage,
		                           Point locationAfterDraw){
			
			if (singlePage == null) {
				throw new ArgumentNullException("pageInfo");
			}
			this.printEventArgs = e;
			this.singlePage = singlePage;
			this.forceNewPage = forceNewPage;
			this.locationAfterDraw = locationAfterDraw;
		}
Example #9
0
        public override T Evaluate(IExpressionContext context)
        {
            ISinglePage singlePage = context.ContextObject as ISinglePage;

            if (singlePage != null)
            {
                return(EvaluateSinglePage(context));
            }
            else
            {
                return(EvaluateFromContext(context));
            }
        }
 public ReportPageEventArgs(PrintPageEventArgs e,
                            ISinglePage singlePage,
                            bool forceNewPage,
                            Point locationAfterDraw)
 {
     if (singlePage == null)
     {
         throw new ArgumentNullException("singlePage");
     }
     this.printEventArgs    = e;
     this.singlePage        = singlePage;
     this.forceNewPage      = forceNewPage;
     this.locationAfterDraw = locationAfterDraw;
 }
Example #11
0
		public static IBaseRenderer  CreateRenderer (BaseReportItem itemToConvert,IDataNavigator dataNavigator,
		                                   ISinglePage singlePage,ILayouter layouter,BaseSection section)
		{

			Type t = itemToConvert.GetType();
			if (t.Equals(typeof(BaseTableItem))) {
				return new RenderTable(dataNavigator,Rectangle.Empty,singlePage,layouter,section);
			}
			
			if (t.Equals(typeof(BaseRowItem))) {
//				return new GroupedRowConverter (dataNavigator,singlePage,layouter);
//				Console.WriteLine("render Row");
			}
			return null;
		}
Example #12
0
        public static IBaseRenderer  CreateRenderer(BaseReportItem itemToConvert, IDataNavigator dataNavigator,
                                                    ISinglePage singlePage, ILayouter layouter, BaseSection section)
        {
            Type t = itemToConvert.GetType();

            if (t.Equals(typeof(BaseTableItem)))
            {
                Console.WriteLine("render Table");
                return(new RenderTable(dataNavigator, Rectangle.Empty, singlePage, layouter, section));
            }

            if (t.Equals(typeof(BaseRowItem)))
            {
//				return new GroupedRowConverter (dataNavigator,singlePage,layouter);
                Console.WriteLine("render Row");
            }
            return(null);
        }
        public override string Evaluate(SimpleExpressionEvaluator.Evaluation.IExpressionContext context)
        {
            Variable variable = Arguments[0] as Variable;
            string   retval   = string.Empty;

            ISinglePage singlePage = context.ContextObject as SinglePage;

            if (singlePage != null)
            {
                return(ExtractValueFromSinglePage(ref variable, singlePage, ref retval));
            }

            DataRow row = context.ContextObject as DataRow;

            if (row != null)
            {
                return(ExtractValueFromDataRow(ref variable, retval, row));
            }
            return(variable.VariableName);
        }
Example #14
0
        public override string Evaluate(SimpleExpressionEvaluator.Evaluation.IExpressionContext context)
        {
            ISinglePage singlePage = context.ContextObject as SinglePage;
            Variable    variable   = Arguments[0] as Variable;

            if (singlePage.IDataNavigator.CurrentRow > -1)
            {
                var dataRow = singlePage.IDataNavigator.GetDataRow();
                var item    = dataRow.Find(variable.VariableName);

                string retval;
                if (item != null)
                {
                    retval = item.Value.ToString();
                }
                else
                {
                    retval = GlobalValues.UnkownFunctionMessage(variable.VariableName);
                }
                return(retval);
            }
            return(variable.VariableName);
        }
Example #15
0
		public static void InitPage (ISinglePage singlePage,ReportSettings reportSettings)
		{
			singlePage.ReportFileName = reportSettings.FileName;
			singlePage.ReportName = reportSettings.ReportName;
			singlePage.ParameterHash = reportSettings.ParameterCollection.CreateHash();	
		}
Example #16
0
        private IDataNavigator NavigatorFromContext(IExpressionContext context)
        {
            ISinglePage p = context.ContextObject as ISinglePage;

            return(p.IDataNavigator);
        }