Click here to Skip to main content
15,884,472 members
Articles / Programming Languages / C#

EasiReports

Rate me:
Please Sign up or sign in to vote.
4.87/5 (64 votes)
13 Feb 2006CPOL6 min read 480K   9.7K   219  
A library to add reports to your application.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace EasiReporter
{
	/// <summary>
	/// Summary description for DlgSetZoom.
	/// </summary>
	public class DlgSetZoom : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label2;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.NumericUpDown NumericUpDownPercent;

		private EasiReports.ReportControl ReportControl = null;

		public int Percent
		{
			get
			{
				return (int) NumericUpDownPercent.Value;
			}

			set
			{
				NumericUpDownPercent.Value = value;
				ReportControl.SetDesignViewZoom( false, Percent );
			}
		}

		public DlgSetZoom( EasiReports.ReportControl ReportControl )
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.ReportControl = ReportControl;
		}

		/// <summary>Clean up any resources being used.</summary>
		/// <param name="disposing"><b>true</b> to release both managed and unmanaged resources; <b>false</b> to release only unmanaged resources.</param>
		/// <remarks>Releases the unmanaged resources and optionally releases the managed resources.</remarks>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.NumericUpDownPercent = new System.Windows.Forms.NumericUpDown();
			this.label2 = new System.Windows.Forms.Label();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDownPercent)).BeginInit();
			this.SuspendLayout();
			// 
			// NumericUpDownPercent
			// 
			this.NumericUpDownPercent.Increment = new System.Decimal(new int[] {
																				   10,
																				   0,
																				   0,
																				   0});
			this.NumericUpDownPercent.Location = new System.Drawing.Point(8, 8);
			this.NumericUpDownPercent.Maximum = new System.Decimal(new int[] {
																				 1000,
																				 0,
																				 0,
																				 0});
			this.NumericUpDownPercent.Minimum = new System.Decimal(new int[] {
																				 50,
																				 0,
																				 0,
																				 0});
			this.NumericUpDownPercent.Name = "NumericUpDownPercent";
			this.NumericUpDownPercent.Size = new System.Drawing.Size(64, 20);
			this.NumericUpDownPercent.TabIndex = 0;
			this.NumericUpDownPercent.Value = new System.Decimal(new int[] {
																			   1000,
																			   0,
																			   0,
																			   0});
			this.NumericUpDownPercent.ValueChanged += new System.EventHandler(this.Percent_ValueChanged);
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(80, 8);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(56, 20);
			this.label2.TabIndex = 1;
			this.label2.Text = "percent";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// DlgSetZoom
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(138, 36);
			this.Controls.Add(this.NumericUpDownPercent);
			this.Controls.Add(this.label2);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.Name = "DlgSetZoom";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Set Zoom";
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDownPercent)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Percent_ValueChanged( object sender, System.EventArgs e )
		{
			ReportControl.SetDesignViewZoom( false, Percent );
		}
	}
}

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
United Kingdom United Kingdom
I discovered C# and .NET 1.0 Beta 1 in late 2000 and loved them immediately.
I have been writing software professionally in C# ever since

In real life, I have spent 3 years travelling abroad,
I have held a UK Private Pilots Licence for 20 years,
and I am a PADI Divemaster.

I now live near idyllic Bournemouth in England.

I can work 'virtually' anywhere!

Comments and Discussions