DeviceInfo.cs

using System;
using System.Collections.Generic;
using System.Text;

namespace FB.PrintHelper
{
    public class DeviceInfo
    {
        private bool m_Landscape = false;

        public bool Landscape
        {
            get
            {
                return this.m_Landscape;
            }
            set
            {
                this.m_Landscape = value;
            }
        }

        /*
         * The pixel depth of the color range supported by the image output. 
         * Valid values are 1, 4, 8, 24, and 32. 
         * The default value is 24. 
         * ColorDepth is only supported for TIFF rendering and is otherwise ignored by the report server for other image output formats. 
         * Note: 
         * For this release of SQL Server, the value of this setting is ignored, and the TIFF image is always rendered as 24-bit.
        */
        private int m_ColorDepth = 24;

        public int ColorDepth
        {
            get
            {
                return this.m_ColorDepth;
            }
        }


        /*
         * The number of columns to set for the report. This value overrides the report's original settings.
         * 
         * not used
         * 
        */
        private int m_Columns = 0;

        public int Columns
        {
            get
            {
                return this.m_Columns;
            }
            set
            {
                this.m_Columns = value;
            }
        }


        /*
         * The column spacing to set for the report. This value overrides the report's original settings.
         * 
         * not used
         * 
        */
        private int m_ColumnSpacing = 0;

        public int ColumnSpacing
        {
            get
            {
                return this.m_ColumnSpacing;
            }
            set
            {
                this.m_ColumnSpacing = value;
            }
        }

        /*
         * The resolution of the output device in x-direction. The default value is 96.
         * 
        */
        private int m_DpiX = 96;

        public int DpiX
        {
            get
            {
                return this.m_DpiX;
            }
            set
            {
                this.m_DpiX = value;
            }
        }


        /*
         * The resolution of the output device in y-direction. The default value is 96.
         * 
        */
        private int m_DpiY = 96;

        public int DpiY
        {
            get
            {
                return this.m_DpiY;
            }
            set
            {
                this.m_DpiY = value;
            }
        }


        /*
         * The last page of the report to render. The default value is the value for StartPage.
         * 
         */
        private int m_EndPage = 0;

        public int EndPage
        {
            get
            {
                return this.m_EndPage;
            }
            set
            {
                this.m_EndPage = value;
            }
        }


        /*
         * The first page of the report to render. A value of 0 indicates that all pages are rendered. The default value is 1.
         * 
         */
        private int m_StartPage = 1;

        public int StartPage
        {
            get
            {
                return this.m_StartPage;
            }
            set
            {
                this.m_StartPage = value;
            }
        }

        /*
         * The bottom margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginBottom = 0;

        public decimal MarginBottom
        {
            get
            {
                return this.m_MarginBottom;
            }
            set
            {
                this.m_MarginBottom = value;
            }
        }


        /*
         * The top margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginTop = 0;

        public decimal MarginTop
        {
            get
            {
                return this.m_MarginTop;
            }
            set
            {
                this.m_MarginTop = value;
            }
        }


        /*
         * The left margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginLeft = 0;

        public decimal MarginLeft
        {
            get
            {
                return this.m_MarginLeft;
            }
            set
            {
                this.m_MarginLeft = value;
            }
        }


        /*
         * The right margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         *  
         */
        private decimal m_MarginRight = 0;

        public decimal MarginRight
        {
            get
            {
                return this.m_MarginRight;
            }
            set
            {
                this.m_MarginRight = value;
            }
        }

        /*
         * One of the Graphics Device Interface (GDI) supported output formats: BMP, EMF, GIF, JPEG, PNG, or TIFF.
         * 
         */
        private string m_OutputFormat = "EMF";

        public string OutputFormat
        {
            get
            {
                return this.m_OutputFormat;
            }
            set
            {
                this.m_OutputFormat = value;
            }
        }

        /*
         * The page height, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 11in). This value overrides the report's original settings.
         * 
         */
        private decimal m_PageHeight = 0;

        public decimal PageHeight
        {
            get
            {
                return this.m_PageHeight;
            }
            set
            {
                this.m_PageHeight = value;
            }
        }


        /*
         * The page width, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 8.5in). This value overrides the report's original settings.
         * 
         * 
        */
        private decimal m_PageWidth = 0;

        public decimal PageWidth
        {
            get
            {
                return this.m_PageWidth;
            }
            set
            {
                this.m_PageWidth = value;
            }
        }

        public string DeviceInfoString
        {
            get
            {
                string strRet = string.Empty;

                strRet += "" +
                    "  " + this.m_OutputFormat + "";

                if (this.m_Landscape)
                    strRet +=
                        "  " + this.m_PageHeight.ToString() + "cm" +
                        "  " + this.m_PageWidth.ToString() + "cm";
                else
                    strRet +=
                        "  " + this.m_PageWidth.ToString() + "cm" +
                        "  " + this.m_PageHeight.ToString() + "cm";

                strRet +=
                        "  " + this.m_MarginTop.ToString() + "cm" +
                        "  " + this.m_MarginLeft.ToString() + "cm" +
                        "  " + this.m_MarginRight.ToString() + "cm" +
                        "  " + this.m_MarginBottom.ToString() + "cm";

                strRet += "";

                return strRet;

            }
        }

    }
}


 
 

你可能感兴趣的:(报表打印)