Click here to Skip to main content
15,896,063 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.6K   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 MyNRDesigner.Forms
{
	/// <summary>
	/// Descrizione di riepilogo per BarcodeWizard.
	/// </summary>
	public class BarcodeWizard : System.Windows.Forms.Form
	{
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ListBox lstBarcodes;
		/// <summary>
		/// Variabile di progettazione necessaria.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public BarcodeWizard()
		{
			//
			// Necessario per il supporto di Progettazione Windows Form
			//
			InitializeComponent();

			//
			// TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
			//
		}

		/// <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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BarcodeWizard));
            this.lstBarcodes = new System.Windows.Forms.ListBox();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // lstBarcodes
            // 
            this.lstBarcodes.Location = new System.Drawing.Point(8, 36);
            this.lstBarcodes.Name = "lstBarcodes";
            this.lstBarcodes.Size = new System.Drawing.Size(192, 95);
            this.lstBarcodes.TabIndex = 0;
            // 
            // button1
            // 
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.Location = new System.Drawing.Point(212, 36);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(120, 28);
            this.button1.TabIndex = 1;
            this.button1.Text = "&Ok";
            // 
            // button2
            // 
            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button2.Location = new System.Drawing.Point(212, 72);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(120, 28);
            this.button2.TabIndex = 2;
            this.button2.Text = "&Cancel";
            // 
            // 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, ((System.Byte)(0)));
            this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label1.Location = new System.Drawing.Point(4, 4);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(332, 24);
            this.label1.TabIndex = 3;
            this.label1.Text = " Choose barcode type";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // BarcodeWizard
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(342, 136);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.lstBarcodes);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "BarcodeWizard";
            this.Text = "Barcode Selector";
            this.Load += new System.EventHandler(this.BarcodeWizard_Load);
            this.ResumeLayout(false);

        }
		#endregion

        public NeoDataType.MyNeoReport.Barcode GetBarcodeIstance()
        {
            if (lstBarcodes.SelectedIndex >= 0)
            {
                Barcode b = (Barcode)typeof(Barcode).Assembly.CreateInstance("NeoDataType.MyNeoReport.Barcode" + lstBarcodes.Text);
                return b;
            }
            return null;
        }

        private void BarcodeWizard_Load(object sender, System.EventArgs e)
        {
            foreach(Type itm in typeof(Barcode).Assembly.GetTypes())
            {
                if (itm.IsClass)
                    if (itm.BaseType.Equals(typeof(NeoDataType.MyNeoReport.Barcode)))
                    {
                        lstBarcodes.Items.Add(Barcode.GetCodeName(itm));
                    }
            }
        }
	}
}

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