示例#1
0
		public System.Data.DataSet ReadData()
		{
			ContributorsList contributorsList = new ContributorsList();
			DataSet ds = new DataSet();
			ds.Tables.Add(contributorsList.ContributorTable);
			return ds;
		}
        public void NullValue_In_Property_Should_Return_EmptyString()
        {
            ContributorsList contributorsList = new ContributorsList();
            var contColl = contributorsList.ContributorCollection;

            foreach (Contributor element in contColl)
            {
                element.GroupItem = null;
            }

            IDataManager   dm      = ICSharpCode.Reports.Core.DataManager.CreateInstance(contColl, new ReportSettings());
            IDataNavigator dataNav = dm.GetNavigator;


            ReportItemCollection searchCol = new ReportItemCollection();

            searchCol.Add(new BaseDataItem()
            {
                Name       = "GroupItem",
                ColumnName = "GroupItem"
            }
                          );
            dataNav.Reset();
            dataNav.MoveNext();
            do
            {
                dataNav.Fill(searchCol);
                BaseDataItem resultItem = searchCol[0] as BaseDataItem;

                Assert.That(resultItem.Name, Is.EqualTo("GroupItem"));
                Assert.That(resultItem.DBValue, Is.EqualTo(String.Empty));
            }while (dataNav.MoveNext());
        }
示例#3
0
        public System.Data.DataSet ReadData()
        {
            ContributorsList contributorsList = new ContributorsList();
            DataSet          ds = new DataSet();

            ds.Tables.Add(contributorsList.ContributorTable);
            return(ds);
        }
        public void Dispose()
        {
            if (this.contributorsList == null)
            {
                this.contributorsList = null;
            }

//			if (this.testTable != null) {
//				this.testTable = null;
//				this.testTable.Dispose();
//			}
        }
        public void LoadFromStream()
        {
            var contributorList = new ContributorsList();
            var list = contributorList.ContributorCollection;

            var asm = Assembly.GetExecutingAssembly();
            var stream = asm.GetManifestResourceStream(TestHelper.GroupedList);

            var reportingFactory  = new ReportingFactory();
            var model =  reportingFactory.LoadReportModel (stream);
            reportCreator = new DataPageBuilder(model,list);
        }
        void Button_Small(object sender, RoutedEventArgs e)
        {
            var stream = LoadSmallResource();
            var cl = new ContributorsList();
            var cc = cl.SmallContributorCollection;

            var rf = new ReportingFactory();
            var reportCreator = rf.ReportCreator (stream,cc);
            reportCreator.BuildExportList();

            var previewViewModel = new PreviewViewModel (rf.ReportModel.ReportSettings,reportCreator.Pages);
            viewer.SetBinding(previewViewModel);
        }
        public void LoadFromStream()
        {
            var contributorList = new ContributorsList();
            var list            = contributorList.ContributorCollection;

            var asm    = Assembly.GetExecutingAssembly();
            var stream = asm.GetManifestResourceStream(TestHelper.GroupedList);

            var reportingFactory = new ReportingFactory();
            var model            = reportingFactory.LoadReportModel(stream);

            reportCreator = new DataPageBuilder(model, list);
        }
        public void CanCreateReportCreatorFromList()
        {
            var contributorList = new ContributorsList();
            var list = contributorList.ContributorCollection;

            var asm = Assembly.GetExecutingAssembly();
            var stream = asm.GetManifestResourceStream(TestHelper.ReportFromList);

            var reportingFactory  = new ReportingFactory();
            var rc = reportingFactory.ReportCreator(stream,list);
            Assert.That(rc,Is.Not.Null);
            Assert.That(rc,Is.TypeOf(typeof(DataPageBuilder)));
        }
示例#9
0
        public void CanCreateReportCreatorFromList()
        {
            var contributorList = new ContributorsList();
            var list            = contributorList.ContributorCollection;

            var asm    = Assembly.GetExecutingAssembly();
            var stream = asm.GetManifestResourceStream(TestHelper.ReportFromList);

            var reportingFactory = new ReportingFactory();
            var rc = reportingFactory.ReportCreator(stream, list);

            Assert.That(rc, Is.Not.Null);
            Assert.That(rc, Is.TypeOf(typeof(DataPageBuilder)));
        }
        // GET: /Home/ContributorsList/
        public ActionResult ContributorsList()
        {
            var contributors = new ContributorsList().SmallContributorCollection;

            var reportDefinitionAsStream = LoadStreamFromResource("FromListNowRow.srd");

            var rf = new ReportingFactory();
            var reportCreator = rf.ReportCreator(reportDefinitionAsStream, contributors);
            reportCreator.BuildExportList();

            var ms = new MemoryStream();
            PdfExporter ex = new PdfExporter(reportCreator.Pages);
            ex.Run(ms);

            ms.Seek(0, SeekOrigin.Begin);
            return File(ms, "application/pdf", "contributors.pdf");
        }
        public void CreateExportlist()
        {
            reportItemCollection = new Collection<ExportText>();
            reportItemCollection.Add(new ExportText()
                           {
                           	Text = String.Empty
                           });

            var contributorList = new ContributorsList();
            list = contributorList.ContributorCollection;
            reportSettings = new ReportSettings();
            reportSettings.GroupColumnsCollection.Add(

                new GroupColumn("groupItem",1,ListSortDirection.Ascending )
            );

            dataSource = new CollectionDataSource(list,reportSettings);
            dataSource.Bind();
        }
示例#12
0
        // GET: /Home/ContributorsList/
        public ActionResult ContributorsList()
        {
            var contributors = new ContributorsList().SmallContributorCollection;

            var reportDefinitionAsStream = LoadStreamFromResource("FromListNowRow.srd");

            var rf            = new ReportingFactory();
            var reportCreator = rf.ReportCreator(reportDefinitionAsStream, contributors);

            reportCreator.BuildExportList();

            var         ms = new MemoryStream();
            PdfExporter ex = new PdfExporter(reportCreator.Pages);

            ex.Run(ms);

            ms.Seek(0, SeekOrigin.Begin);
            return(File(ms, "application/pdf", "contributors.pdf"));
        }
        public void CreateExportlist()
        {
            reportItemCollection = new Collection <ExportText>();
            reportItemCollection.Add(new ExportText()
            {
                Text = String.Empty
            });

            var contributorList = new ContributorsList();

            list           = contributorList.ContributorCollection;
            reportSettings = new ReportSettings();
            reportSettings.GroupColumnsCollection.Add(

                new GroupColumn("groupItem", 1, ListSortDirection.Ascending)
                );

            dataSource = new CollectionDataSource(list, reportSettings);
            dataSource.Bind();
        }
        protected void createPdf(object sender, EventArgs e)
        {
            var contributors = new ContributorsList().SmallContributorCollection;

            var reportDefinitionAsStream = LoadStreamFromResource("FromListNowRow.srd");

            var rf = new ReportingFactory();
            var reportCreator = rf.ReportCreator(reportDefinitionAsStream, contributors);
            reportCreator.BuildExportList();

            var ms = new MemoryStream();
            PdfExporter ex = new PdfExporter(reportCreator.Pages);
            ex.Run(ms);

            ms.Seek(0, SeekOrigin.Begin);

            Response.ContentType = "application/pdf";
            Response.BinaryWrite(ms.ToArray());
            Response.End();
        }
		public void Init()
		{
			ContributorsList contributorsList = new ContributorsList();
			this.contributorCollection = contributorsList.ContributorCollection;
		}
        public void Init()
        {
            ContributorsList contributorsList = new ContributorsList();

            this.table = contributorsList.ContributorTable;
        }
		public void CreateList() {
			var contributorList = new ContributorsList();
			list = contributorList.ContributorCollection;
		}	
示例#18
0
		public void Init()
		{
			ContributorsList contributorsList = new ContributorsList();
			this.table = contributorsList.ContributorTable;
		}
 public void Init()
 {
     this.contributorsList = new ContributorsList();
 }
        public void Init()
        {
            ContributorsList contributorsList = new ContributorsList();

            this.contributorCollection = contributorsList.ContributorCollection;
        }
		public void NullValue_In_Property_Should_Return_EmptyString ()
		{
			ContributorsList contributorsList = new ContributorsList();
			var contColl = contributorsList.ContributorCollection;
			
			foreach (Contributor element in contColl) {
				element.GroupItem = null;
			}
			
			IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(contColl, new ReportSettings());
			IDataNavigator dataNav = dm.GetNavigator;
			
			
			ReportItemCollection searchCol = new ReportItemCollection();
			searchCol.Add(new BaseDataItem ()
			             {
			             	Name ="GroupItem",
			             	ColumnName ="GroupItem"
			             		
			             }
			            );
			dataNav.Reset();
			dataNav.MoveNext();
			do 
			{
				dataNav.Fill(searchCol);
				BaseDataItem resultItem = searchCol[0] as BaseDataItem;
				
				Assert.That (resultItem.Name,Is.EqualTo("GroupItem"));
				Assert.That(resultItem.DBValue,Is.EqualTo(String.Empty));
				
			}
			while (dataNav.MoveNext());
		}
        void List_To_Pdf(object sender, RoutedEventArgs e)
        {
            var stream = LoadListResource();

            var cl = new ContributorsList();
            var cc = cl.ContributorCollection;

            var rf = new ReportingFactory();
            var reportCreator = rf.ReportCreator (stream,cc);
            reportCreator.BuildExportList();
            PdfExporter ex = new PdfExporter(reportCreator.Pages);
            ex.Run();
        }
		public void Init()
		{
			this.contributorsList = new ContributorsList();
		}
		public void Dispose()
		{
			if (this.contributorsList == null) {
				this.contributorsList = null;
			}
			
//			if (this.testTable != null) {
//				this.testTable = null;
//				this.testTable.Dispose();
//			}
		}