Click here to Skip to main content
15,896,726 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;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.ComponentModel.Design.Serialization;

namespace UniverseReport
{
    [Serializable()]
    [TypeConverter(typeof(CellFormatConverter))]
    public class ReportData
    {

        private ColumnCellCollection columnCells = new ColumnCellCollection();
        private Collection<LineInfo> lines = new Collection<LineInfo>();
        private Collection<TextSection> textSections = new Collection<TextSection>();
        private Collection<RowCellInfo> freeFormCells = new Collection<RowCellInfo>();
        private Collection<ReportRectangle> rectangles = new Collection<ReportRectangle>();
        private Collection<ReportImage> images = new Collection<ReportImage>();

        private Group group = new Group();
        private Group subGroup = new Group();
        private Group subGroup2 = new Group();

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Group Group
        {
            get { return group; }
            set { group = value; }
        }
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Group SubGroup
        {
            get { return subGroup; }
            set { subGroup = value; }
        }
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Group SubGroup2
        {
            get { return subGroup2; }
            set { subGroup2 = value; }
        }


        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public ColumnCellCollection ColumnCellCollection
        {
            get { return columnCells; }
            set { columnCells = value; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Shapes")]
        public Collection<LineInfo> Lines
        {
            get { return lines; }
            set { lines = value; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Shapes")]
        public Collection<ReportRectangle> Rectangles
        {
            get { return rectangles; }
            set { rectangles = value; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Shapes")]
        public Collection<ReportImage> Images
        {
            get { return images; }
            set { images = value; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Collection<TextSection> TextSections
        {
            get { return textSections; }

        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Collection<RowCellInfo> FreeFormCells
        {
            get { return freeFormCells; }
            set { freeFormCells = value; }
        }

        public void AddTextSection(string text)
        {
            textSections.Add(new TextSection(text));
        }

        public void AddTextSection(string text, bool outline)
        {
            textSections.Add(new TextSection(text, outline));
        }

        public void AddTextSection(string text, int width, int height)
        {
            textSections.Add(new TextSection(text, width, height));
        }


    }
}

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