Click here to Skip to main content
15,895,256 members
Articles / Programming Languages / Visual Basic

A New .NET Reporting Way

Rate me:
Please Sign up or sign in to vote.
4.67/5 (50 votes)
29 Sep 2007CPOL3 min read 406.4K   17.5K   248  
Looking for a free and simple way to design and add reports to your .NET application? Take a look at MyNeoReport library.
/////////////////////////////////////////////////////////////////////////////////
// MyNeoReport Designer
// --------------------
// Project Copyright (C)    : Fabio Zanetta, email: support@neodatatype.net
// Portions Copyright (C)   : Microsoft Corporation. All Rights Reserved.
// License                  : docs/license.txt
// ------------------------------------------------------------------------------
// File created by          : Fabio Zanetta, email: support@neodatatype.net
// ------------------------------------------------------------------------------
// Please, if you modify some parts of this file mark them as described in
// docs/modify_guidelines.txt
/////////////////////////////////////////////////////////////////////////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using NeoDataType.MyNeoReport;

namespace SimpleDesigner
{
	/// <summary>
	/// Descrizione di riepilogo per BrowseSectionForm.
	/// </summary>
	public class BrowseSectionForm : System.Windows.Forms.Form
	{
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.ListBox sectionList;
        private System.Windows.Forms.Label label1;
		/// <summary>
		/// Variabile di progettazione necessaria.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public BrowseSectionForm(Page page)
		{
			//
			// Necessario per il supporto di Progettazione Windows Form
			//
			InitializeComponent();


            sc = page.Sections;
            foreach (Section s in sc)
            {
                string st = s.ToString();
                //if (s is GroupSection)
                //    st += ", Group on " + ((GroupSection)s).GroupFieldList;//.DataField;
                sectionList.Items.Add(st);
            }
		}

		/// <summary>
		/// Pulire le risorse in uso.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Codice generato da Progettazione Windows Form
		/// <summary>
		/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
		/// il contenuto del metodo con l'editor di codice.
		/// </summary>
		private void InitializeComponent()
		{
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BrowseSectionForm));
            this.button2 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.sectionList = new System.Windows.Forms.ListBox();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // button2
            // 
            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button2.Location = new System.Drawing.Point(296, 80);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(120, 32);
            this.button2.TabIndex = 4;
            this.button2.Text = "&Cancel";
            // 
            // button1
            // 
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.Location = new System.Drawing.Point(296, 40);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(120, 32);
            this.button1.TabIndex = 3;
            this.button1.Text = "&Ok";
            // 
            // sectionList
            // 
            this.sectionList.Location = new System.Drawing.Point(8, 40);
            this.sectionList.Name = "sectionList";
            this.sectionList.Size = new System.Drawing.Size(280, 134);
            this.sectionList.TabIndex = 5;
            this.sectionList.SelectedIndexChanged += new System.EventHandler(this.sectionList_SelectedIndexChanged);
            // 
            // label1
            // 
            this.label1.BackColor = System.Drawing.SystemColors.ControlDark;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(408, 24);
            this.label1.TabIndex = 6;
            this.label1.Text = " Select the working section";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // BrowseSectionForm
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(424, 180);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.sectionList);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "BrowseSectionForm";
            this.Text = "BrowseSectionForm";
            this.Load += new System.EventHandler(this.BrowseSectionForm_Load);
            this.ResumeLayout(false);

        }
		#endregion


        private Section _selectedSection = null;
        private SectionCollection sc = null;

        private void sectionList_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (sectionList.SelectedItem != null)
                _selectedSection = sc[sectionList.SelectedItem.ToString().Split(' ')[0]];
        }

        private void BrowseSectionForm_Load(object sender, System.EventArgs e)
        {
        
        }

        public Section SelectedSection
        {
            get { return _selectedSection; }
        }

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions