Exemplo n.º 1
0
 internal static bool showPrintDialog(
     PrintDialog printDialog,
     ref string deviceName,
     ref string driverName,
     ref string port,
     ref csReportPaperType paperSize,
     ref int orientation,
     ref int fromPage,
     ref int toPage,
     ref int copies,
     ref int paperBin)
 {
     printDialog.AllowSomePages = true;
     var settings = printDialog.PrinterSettings;
     settings.PrinterName = deviceName;
     settings.FromPage = fromPage;
     settings.ToPage = toPage;
     settings.Copies = (short)copies;
     if (printDialog.ShowDialog() == DialogResult.OK)
     {
         deviceName = settings.PrinterName;
         fromPage = settings.FromPage;
         toPage = settings.ToPage;
         copies = settings.Copies;
         return true;
     }
     else
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public void initDialog(csReportPaperType paperSize, int customHeight, int customWidth, int orientation)
 {
     m_customHeight = customHeight;
     m_customWidth = customWidth;
     m_orientation = orientation;
     m_paperSize = paperSize;
 }
Exemplo n.º 3
0
        public bool starDoc(PrintDocument printDoc, String title, csReportPaperType paperSize, int orientation)
        {
            printDoc.DefaultPageSettings.Landscape = (orientation == (int)csRptPageOrientation.LANDSCAPE);
            printDoc.DefaultPageSettings.PaperSize = getPaperSize(paperSize);

            return(true);
        }
Exemplo n.º 4
0
 public void initDialog(csReportPaperType paperSize, int customHeight, int customWidth, int orientation)
 {
     m_customHeight = customHeight;
     m_customWidth  = customWidth;
     m_orientation  = orientation;
     m_paperSize    = paperSize;
 }
Exemplo n.º 5
0
        internal static bool showPrintDialog(
            PrintDialog printDialog,
            ref string deviceName,
            ref string driverName,
            ref string port,
            ref csReportPaperType paperSize,
            ref int orientation,
            ref int fromPage,
            ref int toPage,
            ref int copies,
            ref int paperBin)
        {
            printDialog.AllowSomePages = true;
            var settings = printDialog.PrinterSettings;

            settings.PrinterName = deviceName;
            settings.FromPage    = fromPage;
            settings.ToPage      = toPage;
            settings.Copies      = (short)copies;
            if (printDialog.ShowDialog() == DialogResult.OK)
            {
                deviceName = settings.PrinterName;
                fromPage   = settings.FromPage;
                toPage     = settings.ToPage;
                copies     = settings.Copies;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 6
0
 private void cmd_apply_Click(object sender, EventArgs e)
 {
     m_ok           = true;
     m_customHeight = (int)cUtil.val(tx_height.Text);
     m_customWidth  = (int)cUtil.val(tx_width.Text);
     m_paperSize    = (csReportPaperType)cUtil.listID(cb_paperSize);
     m_orientation  = op_landscape.Checked ? (int)csRptPageOrientation.LANDSCAPE : (int)csRptPageOrientation.PORTRAIT;
     this.Hide();
 }
Exemplo n.º 7
0
        internal bool load(CSXml.cXml xDoc, XmlNode nodeObj)
        {
            if (nodeObj != null)
            {
                m_height       = xDoc.getNodeProperty(nodeObj, "Height").getValueInt(eTypes.eLong);
                m_paperSize    = (csReportPaperType)xDoc.getNodeProperty(nodeObj, "PaperSize").getValueInt(eTypes.eInteger);
                m_width        = xDoc.getNodeProperty(nodeObj, "Width").getValueInt(eTypes.eLong);
                m_orientation  = xDoc.getNodeProperty(nodeObj, "Orientation").getValueInt(eTypes.eInteger);
                m_customWidth  = xDoc.getNodeProperty(nodeObj, "CustomWidth").getValueInt(eTypes.eLong);
                m_customHeight = xDoc.getNodeProperty(nodeObj, "CustomHeight").getValueInt(eTypes.eLong);
            }

            return(true);
        }
Exemplo n.º 8
0
        public static RectangleF getRectFromPaperSize(cReportPaperInfo info, csReportPaperType paperSize, int orientation)
        {
            RectangleF rtn = new RectangleF();

            switch (paperSize)
            {
            case csReportPaperType.CSRPTPAPERTYPELETTER:
                rtn.Height = getPixelsFromCmY(27.94f);     // 15840;
                rtn.Width  = getPixelsFromCmX(21.59f);     // 12240;
                break;

            case csReportPaperType.CSRPTPAPERTYPELEGAL:
                rtn.Height = getPixelsFromCmY(35.56f);     // 20160;
                rtn.Width  = getPixelsFromCmX(21.59f);     // 12060;
                break;

            case csReportPaperType.CSRPTPAPERTYPEA4:
                rtn.Height = getPixelsFromCmY(29.7f);     // 16832;
                rtn.Width  = getPixelsFromCmX(21f);       // 11908;
                break;

            case csReportPaperType.CSRPTPAPERTYPEA3:
                rtn.Height = getPixelsFromCmY(42f);     // 23816;
                rtn.Width  = getPixelsFromCmX(29.7f);   // 16832;
                break;

            case csReportPaperType.CSRPTPAPERUSER:
                if (info == null)
                {
                    string msg = "The settings for the custome user paper size is not defined";
                    throw new ReportPaintException(csRptPaintErrors.CSRPT_PAINT_ERR_OBJ_CLIENT, C_MODULE, msg);
                }
                else
                {
                    rtn.Width  = getPixelsFromCmY(info.getCustomWidth());
                    rtn.Height = getPixelsFromCmX(info.getCustomHeight());
                }
                break;
            }

            if (orientation == (int)csRptPageOrientation.LANDSCAPE)
            {
                float tmp = 0;
                tmp        = rtn.Height;
                rtn.Height = rtn.Width;
                rtn.Width  = tmp;
            }

            return(rtn);
        }
Exemplo n.º 9
0
        public bool showDialog(int pages)
        {
            csReportPaperType paperSize = 0;
            int orientation             = 0;
            int fromPage = 0;
            int toPage   = 0;
            int paperBin = 0;

            paperSize   = m_paperInfo.getPaperSize();
            orientation = m_paperInfo.getOrientation();

            fromPage = 1;
            toPage   = pages;

            if (cPrintAPI.showPrintDialog(
                    m_printDialog,
                    ref m_deviceName,
                    ref m_driverName,
                    ref m_port,
                    ref paperSize,
                    ref orientation,
                    ref fromPage,
                    ref toPage,
                    ref m_copies,
                    ref paperBin))
            {
                m_paperInfo.setPaperSize(paperSize);
                m_paperInfo.setOrientation(orientation);
                m_paperInfo.setPagesToPrint(fromPage.ToString() + "-" + toPage.ToString());
                m_paperInfo.setPaperBin(paperBin);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 10
0
        private static void getSizeFromPaperSize(csReportPaperType paperSize, int orientation, out int width, out int height)
        {
            switch (paperSize)
            {
            case csReportPaperType.CSRPTPAPERTYPELETTER:
                height = 279;
                width  = 216;
                break;

            case csReportPaperType.CSRPTPAPERTYPELEGAL:
                height = 356;
                width  = 216;
                break;

            case csReportPaperType.CSRPTPAPERTYPEA4:
                height = 297;
                width  = 210;
                break;

            case csReportPaperType.CSRPTPAPERTYPEA3:
                height = 420;
                width  = 297;
                break;

            default:
                height = 0;
                width  = 0;
                break;
            }

            if (orientation == (int)csRptPageOrientation.LANDSCAPE)
            {
                int tmp = 0;
                tmp    = height;
                height = width;
                width  = tmp;
            }
        }
Exemplo n.º 11
0
        private PaperSize getPaperSize(csReportPaperType paperSize)
        {
            PaperSize size = new PaperSize();

            switch (paperSize)
            {
            case csReportPaperType.CSRPTPAPERTYPEA4:
                size.RawKind = (int)PaperKind.A4;
                break;

            case csReportPaperType.CSRPTPAPERTYPEA3:
                size.RawKind = (int)PaperKind.A3;
                break;

            case csReportPaperType.CSRPTPAPERTYPELETTER:
                size.RawKind = (int)PaperKind.Letter;
                break;

            case csReportPaperType.CSRPTPAPERTYPELEGAL:
                size.RawKind = (int)PaperKind.Legal;
                break;
            }
            return(size);
        }
Exemplo n.º 12
0
 private void cmd_apply_Click(object sender, EventArgs e)
 {
     m_ok = true;
     m_customHeight = (int)cUtil.val(tx_height.Text);
     m_customWidth = (int)cUtil.val(tx_width.Text);
     m_paperSize = (csReportPaperType)cUtil.listID(cb_paperSize);
     m_orientation = op_landscape.Checked ? (int)csRptPageOrientation.LANDSCAPE : (int)csRptPageOrientation.PORTRAIT;
     this.Hide();
 }
Exemplo n.º 13
0
        public bool starDoc(PrintDocument printDoc, String title, csReportPaperType paperSize, int orientation)
        {
            printDoc.DefaultPageSettings.Landscape = (orientation == (int)csRptPageOrientation.LANDSCAPE);
            printDoc.DefaultPageSettings.PaperSize = getPaperSize(paperSize);

            return true;
        }
Exemplo n.º 14
0
        private PaperSize getPaperSize(csReportPaperType paperSize)
        {
            PaperSize size = new PaperSize();

            switch (paperSize) {
                case csReportPaperType.CSRPTPAPERTYPEA4:
                    size.RawKind = (int)PaperKind.A4;
                    break;
                case csReportPaperType.CSRPTPAPERTYPEA3:
                    size.RawKind = (int)PaperKind.A3;
                    break;
                case csReportPaperType.CSRPTPAPERTYPELETTER:
                    size.RawKind = (int)PaperKind.Letter;
                    break;
                case csReportPaperType.CSRPTPAPERTYPELEGAL:
                    size.RawKind = (int)PaperKind.Legal;
                    break;
            }
            return size;
        }
Exemplo n.º 15
0
        private static void getSizeFromPaperSize(csReportPaperType paperSize, int orientation, out int width, out int height)
        {
            switch (paperSize)
            {
                case csReportPaperType.CSRPTPAPERTYPELETTER:
                    height = 279;
                    width = 216;
                    break;

                case csReportPaperType.CSRPTPAPERTYPELEGAL:
                    height = 356;
                    width = 216;
                    break;

                case csReportPaperType.CSRPTPAPERTYPEA4:
                    height = 297;
                    width = 210;
                    break;

                case csReportPaperType.CSRPTPAPERTYPEA3:
                    height = 420;
                    width = 297;
                    break;

                default:
                    height = 0;
                    width = 0;
                    break;
            }

            if (orientation == (int)csRptPageOrientation.LANDSCAPE)
            {
                int tmp = 0;
                tmp = height;
                height = width;
                width = tmp;
            }
        }
        internal bool load(CSXml.cXml xDoc, XmlNode nodeObj)
        {
            if (nodeObj != null)
            {
                m_height = xDoc.getNodeProperty(nodeObj, "Height").getValueInt(eTypes.eLong);
                m_paperSize = (csReportPaperType)xDoc.getNodeProperty(nodeObj, "PaperSize").getValueInt(eTypes.eInteger);
                m_width = xDoc.getNodeProperty(nodeObj, "Width").getValueInt(eTypes.eLong);
                m_orientation = xDoc.getNodeProperty(nodeObj, "Orientation").getValueInt(eTypes.eInteger);
                m_customWidth = xDoc.getNodeProperty(nodeObj, "CustomWidth").getValueInt(eTypes.eLong);
                m_customHeight = xDoc.getNodeProperty(nodeObj, "CustomHeight").getValueInt(eTypes.eLong);
            }

            return true;
        }
Exemplo n.º 17
0
 public void setPaperSize(csReportPaperType rhs)
 {
     m_paperSize = rhs;
 }
Exemplo n.º 18
0
 private void printerSetSizeAndOrient(string p, csReportPaperType csReportPaperType, int p_2)
 {
     // TODO: implement this
     // throw new NotImplementedException();
 }
 public void setPaperSize(csReportPaperType rhs)
 {
     m_paperSize = rhs;
 }
Exemplo n.º 20
0
 public void setPaperSize(csReportPaperType rhs) {
     if (m_report == null) { return; }
     m_report.getPaperInfo().setPaperSize(rhs);
 }
Exemplo n.º 21
0
        public static RectangleF getRectFromPaperSize(cReportPaperInfo info, csReportPaperType paperSize, int orientation)
        {
            RectangleF rtn = new RectangleF();

            switch (paperSize)
            {
                case csReportPaperType.CSRPTPAPERTYPELETTER:
                    rtn.Height = getPixelsFromCmY(27.94f); // 15840;
                    rtn.Width = getPixelsFromCmX(21.59f);  // 12240;
                    break;

                case csReportPaperType.CSRPTPAPERTYPELEGAL:
                    rtn.Height = getPixelsFromCmY(35.56f); // 20160;
                    rtn.Width = getPixelsFromCmX(21.59f);  // 12060;
                    break;

                case csReportPaperType.CSRPTPAPERTYPEA4:
                    rtn.Height = getPixelsFromCmY(29.7f); // 16832;
                    rtn.Width = getPixelsFromCmX(21f);    // 11908;
                    break;

                case csReportPaperType.CSRPTPAPERTYPEA3:
                    rtn.Height = getPixelsFromCmY(42f); // 23816;
                    rtn.Width = getPixelsFromCmX(29.7f);    // 16832;
                    break;

                case csReportPaperType.CSRPTPAPERUSER:
                    if (info == null)
                    {
                        string msg = "The settings for the custome user paper size is not defined";
                        throw new ReportPaintException(csRptPaintErrors.CSRPT_PAINT_ERR_OBJ_CLIENT, C_MODULE, msg);
                    }
                    else
                    {
                        rtn.Width = getPixelsFromCmY(info.getCustomWidth());
                        rtn.Height = getPixelsFromCmX(info.getCustomHeight());
                    }
                    break;
            }

            if (orientation == (int)csRptPageOrientation.LANDSCAPE)
            {
                float tmp = 0;
                tmp = rtn.Height;
                rtn.Height = rtn.Width;
                rtn.Width = tmp;
            }

            return rtn;
        }