Click here to Skip to main content
15,897,291 members
Articles / Desktop Programming / WPF

WPF-Less GDI+.NET Report Component: Star Report

Rate me:
Please Sign up or sign in to vote.
5.00/5 (15 votes)
25 Jan 2013CPOL8 min read 46.7K   1.5K   42  
StarReport: WPF-less GDI+.NET report component.
using System.Collections;
using System.Runtime.Serialization;
using System.ComponentModel.Design.Serialization;
using System;
using System.ComponentModel;

using System.Drawing;
using System.Text;

namespace UniverseReport
{
    /// <summary>
    /// Summary description for ReportRectangle.
    /// </summary>
    /// 
    [TypeConverter(typeof(LineInfoTypeConverter))]
    [Serializable()]
    public class ReportRectangle
    {

        #region My Declarations
        private RectangleF rect = new RectangleF(0, 0, 1, 1);
        private Color color = Color.Black;
        private int thickness = 1;
        private string name = "Rectangle";
        
        #endregion

        #region Constructors
        public ReportRectangle()
        {

        }
        public ReportRectangle(float x, float y, float width, float height)
        {
            rect.X = x;
            rect.Y = y;
            rect.Width = width;
            rect.Height = height;
        }

        public ReportRectangle(float x, float y, float width, float height, Color color)
        {
            rect.X = x;
            rect.Y = y;
            rect.Width = width;
            rect.Height = height;
            this.Color = color;
        }

        public ReportRectangle(float x, float y, float width, float height, Color color, int thickness)
        {
            rect.X = x;
            rect.Y = y;
            rect.Width = width;
            rect.Height = height;
            this.color = color;
            this.thickness = thickness;
        } 
        #endregion

        #region Properties
        [DefaultValue("Rectangle")]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        [Browsable(false)]
        public RectangleF RectangleF
        {
            get { return rect; }
            set { rect = value; }
        }

        [DefaultValue(0)]
        public float X
        {
            get { return rect.X; }
            set { rect.X = value; }
        }

        [DefaultValue(0)]
        public float Y
        {
            get { return rect.Y; }
            set { rect.Y = value; }
        }

        [DefaultValue(1)]
        public float Width
        {
            get { return rect.Width; }
            set { rect.Width = value; }
        }

        [DefaultValue(1)]
        public float Height
        {
            get { return rect.Height; }
            set { rect.Height = value; }
        }



        [DefaultValue(typeof(Color), "Black")]
        public Color Color
        {
            get { return color; }
            set { color = value; }
        }

        [DefaultValue(1)]
        public int Thickness
        {
            get { return thickness; }
            set { thickness = value; }
        } 
        #endregion


    }
}

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
Software Developer (Senior) Finance Industry
United States United States
Currently pursuing 'Programming Nirvana' (The ineffable ultimate in which one has attained disinterested wisdom and compassion as it relates to programming)

Respected Technologies
1. Confusor (https://confuser.codeplex.com/)
2. Power Threading (http://www.wintellect.com/Resources/visit-the-power-threading-library)
3. EDI Parsers (http://www.rdpcrystal.com)


Acknowledgements:

Microsoft Certified Technologist for WPF and .Net 3.5 (MCTS)
Microsoft Certified Technologist for WCF and .Net 3.5 (MCTS)
Microsoft Certified Application Developer for .Net (MCAD)
Microsoft Certified Systems Engineer (MCSE)
Microsoft Certified Professional (MCP)

Sun Certified Developer for Java 2 Platform (SCD)
Sun Certified Programmer for Java 2 Platform (SCP)
Sun Certified Web Component Developer (SCWCD)

CompTIA A+ Certified Professional

Registered Business School Teacher for Computer Programming and Computer Applications (2004)
(University of the State of New York Education Department)

Graduated from University At Stony Brook

Comments and Discussions