예제 #1
0
		/// <summary>
		/// Convert a single item, Location is calculated as follows
		/// </summary>
		/// <param name="offset"> only Y value is used, gives the offset to Items location.Y </param>
		/// <param name="item">Item to convert</param>
		/// <returns></returns>
		
		
		private static void RenderLineItem (BaseReportItem item, Point offset,IExpressionEvaluatorFacade evaluator,ReportPageEventArgs rpea)
		{
			
			Point saveLocation = new Point (item.Location.X,item.Location.Y);
			
			PrintHelper.AdjustChildLocation(item,offset);
			
			IReportExpression epr = item as IReportExpression;
			
			string evaluatedValue = String.Empty;
			
			if (epr != null) {
				try {
					if (!String.IsNullOrEmpty(epr.Expression))
					{
						evaluatedValue =  evaluator.Evaluate(epr.Expression);
						
					} else 
					{
						evaluatedValue =  evaluator.Evaluate(epr.Text);
					}
					epr.Text = evaluatedValue;
					
				} catch (UnknownFunctionException ufe) {
					
					epr.Text = GlobalValues.UnkownFunctionMessage(ufe.Message);
				}
				
			}
			item.Render (rpea);
			item.Location = saveLocation;
		}
예제 #2
0
 public static Rectangle RenderPlainCollection(BaseReportItem parent,
                                               ReportItemCollection items,
                                               IExpressionEvaluatorFacade evaluator,
                                               Point offset,
                                               ReportPageEventArgs rpea)
 {
     if (items.Count > 0)
     {
         foreach (BaseReportItem child in items)
         {
             child.Parent = parent;
             StandardPrinter.RenderLineItem(child, offset, evaluator, rpea);
         }
     }
     return(new Rectangle(offset, parent.Size));
 }
예제 #3
0
        /// <summary>
        /// Convert a single item, Location is calculated as follows
        /// </summary>
        /// <param name="offset"> only Y value is used, gives the offset to Items location.Y </param>
        /// <param name="item">Item to convert</param>
        /// <returns></returns>


        private static void RenderLineItem(BaseReportItem item, Point offset, IExpressionEvaluatorFacade evaluator, ReportPageEventArgs rpea)
        {
            Point saveLocation = new Point(item.Location.X, item.Location.Y);

            PrintHelper.AdjustChildLocation(item, offset);

            IReportExpression epr = item as IReportExpression;

            string evaluatedValue = String.Empty;

            if (epr != null)
            {
                try {
                    if (!String.IsNullOrEmpty(epr.Expression))
                    {
                        evaluatedValue = evaluator.Evaluate(epr.Expression);
                    }
                    else
                    {
                        evaluatedValue = evaluator.Evaluate(epr.Text);
                    }
                    epr.Text = evaluatedValue;
                } catch (UnknownFunctionException ufe) {
                    epr.Text = GlobalValues.UnkownFunctionMessage(ufe.Message);
                }
            }
            item.Render(rpea);
            item.Location = saveLocation;
        }
예제 #4
0
        public static Rectangle RenderContainer(ISimpleContainer simpleContainer, IExpressionEvaluatorFacade evaluator, Point offset, ReportPageEventArgs rpea)
        {
            BaseReportItem item         = simpleContainer as BaseReportItem;
            Rectangle      retVal       = new Rectangle(offset, item.Size);
            Point          saveLocation = item.Location;

            PrintHelper.AdjustChildLocation(item, offset);

            item.Render(rpea);


            if (simpleContainer.Items != null)
            {
                retVal = StandardPrinter.RenderPlainCollection(item, simpleContainer.Items, evaluator, offset, rpea);
            }

            retVal = new Rectangle(retVal.X, retVal.Y,
                                   retVal.X + item.Size.Width,
                                   item.Size.Height + 3 * GlobalValues.GapBetweenContainer);
            item.Location = saveLocation;
            return(retVal);
        }
예제 #5
0
		public static Rectangle RenderContainer (ISimpleContainer simpleContainer,IExpressionEvaluatorFacade evaluator,Point offset,ReportPageEventArgs rpea)
		{
			
			BaseReportItem item = simpleContainer as BaseReportItem;
			Rectangle retVal = new Rectangle(offset,item.Size);
			Point saveLocation = item.Location;
			PrintHelper.AdjustChildLocation(item,offset);
			
			item.Render(rpea);
			
			
			if (simpleContainer.Items != null)  {
				retVal = StandardPrinter.RenderPlainCollection(item,simpleContainer.Items,evaluator,offset,rpea);
			}
		
			retVal = new Rectangle (retVal.X,retVal.Y,
		                        retVal.X + item.Size.Width,
		                        item.Size.Height + 3 * GlobalValues.GapBetweenContainer);
			item.Location = saveLocation;
			return retVal;
		}
예제 #6
0
		public static Rectangle RenderPlainCollection (BaseReportItem parent,
		                                               ReportItemCollection items,
		                                               IExpressionEvaluatorFacade evaluator,
		                                               Point offset,
		                                               ReportPageEventArgs rpea)
		{
			
			if (items.Count > 0) {
				foreach (BaseReportItem child in items) {
					child.Parent = parent;
					 StandardPrinter.RenderLineItem (child,offset,evaluator,rpea);
				}
			}
			return new Rectangle(offset,parent.Size);
		}
예제 #7
0
		private static void RenderLineItem (BaseReportItem item, Point offset,IExpressionEvaluatorFacade evaluator,ReportPageEventArgs rpea)
		{
			
			Point saveLocation = new Point (item.Location.X,item.Location.Y);
			
			PrintHelper.AdjustChildLocation(item,offset);
			
			BaseTextItem textItem = item as BaseTextItem;
			
			
			IReportExpression epr = item as IReportExpression;
			
			if (epr != null) {
				string sss =  evaluator.Evaluate(epr.Expression);
				if (!String.IsNullOrEmpty(sss)) {
					textItem.Text = sss;
				}
			}
			
			
			if (textItem != null) {
				string str = textItem.Text;
				textItem.Text = evaluator.Evaluate(textItem.Text);
				textItem.Render(rpea);
				textItem.Text = str;
			} else {
				item.Render (rpea);
			}
			item.Location = saveLocation;
		}