public void ChangeName()
 {
     var newName = "changed";
     var ti = new BaseTextItem();
     ti.Name = newName;
     Assert.That(ti.Name,Is.EqualTo(newName));
 }
        public void Init()
        {
            container = new BaseSection(){
                Size = new Size (720,60),
                Location = new Point(50,50),
                Name ="Section"
            };

            var item1 = new BaseTextItem(){
                Name = "Item1",
                Location = new Point(10,10),
                Size = new Size (60,20)
            };

            var item2 = new BaseTextItem(){
                Name = "Item2",
                Location = new Point(80,10),
                Size = new Size (60,20)
            };
            container.Items.Add(item1);
            container.Items.Add(item2);

            var bitmap = new Bitmap(700,1000);
            graphics = Graphics.FromImage(bitmap);
        }
Example #3
0
		public void CreateExportText() {
			var ti = new BaseTextItem();
			var exportText = (ExportText)ti.CreateExportColumn();
			Assert.That(exportText.Name,Is.EqualTo(ti.Name));
			Assert.That(exportText.Location,Is.EqualTo(ti.Location));
			Assert.That(exportText.Size,Is.EqualTo(ti.Size));
			Assert.That(exportText.Font , Is.EqualTo(GlobalValues.DefaultFont));
		}
 public void FormatTimeSpanfromTime()
 {
     var ti = new BaseTextItem();
     ti.DataType = "System.TimeSpan";
     ti.FormatString = "hh:mm:ss";
     ti.Text = new TimeSpan(7,17,20).ToString();
     var exportColumn = (ExportText)ti.CreateExportColumn();
     StandardFormatter.FormatOutput(exportColumn);
     Assert.That(ti.Text, Is.EqualTo("07:17:20"));
 }
Example #5
0
		void CreateReportHeader()
		{
			var headerText = new BaseTextItem();
			headerText.Text = "Header";
			headerText.Size = GlobalValues.PreferedSize;
			var printableWith = ReportModel.ReportSettings.PageSize.Width - ReportModel.ReportSettings.LeftMargin - ReportModel.ReportSettings.RightMargin;
			var x = (int)(printableWith - headerText.Size.Width) / 2;
			
			headerText.Location = new Point(x,4);
			ReportModel.ReportHeader.Items.Add(headerText);
			Console.WriteLine("");
			Console.WriteLine("Createreportheader Size {0}",ReportModel.ReportHeader.Size);
		}
Example #6
0
		public void DefaultFontOnInitialize() {
			var ti = new BaseTextItem();
			Assert.That(ti.Font,Is.EqualTo(GlobalValues.DefaultFont));
		}
Example #7
0
		public void IsNameSetOnInitialize() {
			var ti = new BaseTextItem();
			Assert.That (ti.Name,Is.EqualTo("BaseTextItem"));
		}
Example #8
0
		void CreateReportHeader(ReportWizardContext context){
			var pageOneContext = (PageOneContext)context.PageOneContext;
			
			var headerText = new BaseTextItem();
			
			headerText.Text = String.IsNullOrEmpty(pageOneContext.ReportName) ? GlobalValues.DefaultReportName : pageOneContext.ReportName;
			
			var xLoc = (ReportModel.ReportSettings.PrintableWidth() - headerText.Size.Width) / 2;
			headerText.Location = new Point(xLoc,4);
			ReportModel.ReportHeader.Items.Add(headerText);
			
			xLoc = ReportModel.ReportSettings.PrintableWidth() - GlobalValues.PreferedSize.Width - 20;
		
			var dateText = new BaseTextItem(){
				Text ="= Today.Today",
				Location = new Point(xLoc ,10)
			};
			
			ReportModel.ReportHeader.Items.Add(dateText);
		}
Example #9
0
// 
		void CreatePageFooter(ReportWizardContext context)
		{
			var pageOneContext = (PageOneContext)context.PageOneContext;
			var lineNrField = new BaseTextItem() {
				Text = "='Page : ' + Globals!PageNumber + ' of ' + Globals!Pages + ' Page(s)'",
				Name = "LineNumber",
				Location = new Point(300,10),
				Size = new Size (GlobalValues.PreferedSize.Width * 2,GlobalValues.PreferedSize.Height)
			};
			ReportModel.PageFooter.Items.Add(lineNrField);
		}
Example #10
0
		void CreatePageHeader(ReportWizardContext context)
		{
			var pushModelContext = (PushModelContext)context.PushModelContext;
			foreach (var element in pushModelContext.Items) {
				var dataItem = new BaseTextItem(){
					Name = element.ColumnName,
					Text = element.ColumnName
				};
				ReportModel.PageHeader.Items.Add(dataItem);
			}
			
			AdjustItems(ReportModel.PageHeader.Items,startLocation);
			
			var line = new BaseLineItem(){
				Location = new Point(2,35),
				FromPoint = new Point(1,1),
				ToPoint = new Point(ReportModel.ReportSettings.PrintableWidth() -10,1),
				Size = new Size (ReportModel.ReportSettings.PrintableWidth() -5,5)
			};
			
			ReportModel.PageHeader.Items.Add(line);
			
		}
        void CreateReportHeader(ReportWizardContext context)
        {
            var pageOneContext = (PageOneContext)context.PageOneContext;

            var centerLocation = DesignerHelper.AlignCenter(ReportModel.ReportSettings.PrintableWidth(),GlobalValues.PreferedSize.Width);
            var headerText = new BaseTextItem(){
                Text = String.IsNullOrEmpty(pageOneContext.ReportName) ? GlobalValues.DefaultReportName : pageOneContext.ReportName,
                Location = new Point(centerLocation,10)
            };

            ReportModel.ReportHeader.Items.Add(headerText);

            var xLoc = DesignerHelper.AlignRight( ReportModel.ReportSettings.PrintableWidth(),GlobalValues.PreferedSize.Width) - 5;
            var dateText = new BaseTextItem(){
                Text ="= Today.Today",
                Location = new Point(xLoc ,10)
            };

            ReportModel.ReportHeader.Items.Add(dateText);
        }
 void CreatePageFooter()
 {
     var lineNrField = new BaseTextItem() {
         Text = "='Page : ' + Globals!PageNumber + ' of ' + Globals!Pages + ' Page(s)'",
         Name = "LineNumber",
         Size = new Size (GlobalValues.PreferedSize.Width * 2,GlobalValues.PreferedSize.Height)
     };
     var xLoc = DesignerHelper.AlignRight( ReportModel.ReportSettings.PrintableWidth(),lineNrField.Size.Width) - 5;
     lineNrField.Location = new Point(xLoc,10);
     ReportModel.PageFooter.Items.Add(lineNrField);
 }