Esempio n. 1
0
        internal static cPrinter getcPrint(
            PrintDialog printDialog,
            string deviceName,
            string driverName,
            string port,
            int orientation,
            int paperSize,
            int width,
            int height)
        {
            cPrinter o = new cPrinter(printDialog);

            o.setDeviceName(deviceName);
            o.setDriverName(driverName);
            o.setPort(port);

            cReportPaperInfo paperInfo = o.getPaperInfo();

            paperInfo.setOrientation(orientation);
            paperInfo.setPaperSize((csReportPaperType)paperSize);

            if (width == 0 || height == 0)
            {
                getSizeFromPaperSize((csReportPaperType)paperSize, orientation, out width, out height);
            }

            paperInfo.setWidth(width);
            paperInfo.setHeight(height);
            return(o);
        }
Esempio n. 2
0
        // public functions
        public void Dispose()
        {
            m_rows = null;
            m_collRows = null;
            m_vRowsIndexAux = null;
            m_vGroups = null;
            m_vRowsIndex = null;
            m_lastRowIndex = -1;
            m_lastRowPreEvalued = null;
            m_lastRowPostEvalued = null;

            m_controls.clear();
            m_controls = null;

            pDestroyCrossRef(m_headers);
            pDestroyCrossRef(m_details);
            pDestroyCrossRef(m_footers);
            pDestroyCrossRef(m_groups.getGroupsHeaders());
            pDestroyCrossRef(m_groups.getGroupsFooters());

            m_headers.clear();
            m_details.clear();
            m_footers.clear();
            m_groupsHeaders.clear();
            m_groupsFooters.clear();

            m_details.setCopyColl(null);
            m_headers.setCopyColl(null);
            m_footers.setCopyColl(null);
            m_groupsHeaders.setCopyColl(null);
            m_groupsFooters.setCopyColl(null);

            m_headers = null;
            m_details = null;
            m_footers = null;
            m_groupsHeaders = null;
            m_groupsFooters = null;

            m_paperInfo = null;

            m_formulas.clear();
            m_formulas = null;

            m_formulaTypes.clear();
            m_formulaTypes = null;

            m_connect = null;

            m_pages.clear();
            m_pages = null;

            m_pageSetting.clear();
            m_pageSetting = null;

            m_compiler = null;
            m_launchInfo = null;

            m_connectsAux.clear();
            m_connectsAux = null;

            pDestroyImages();
            m_images = null;
        }
Esempio n. 3
0
 public void setPaperInfo(cReportPaperInfo rhs)
 {
     m_paperInfo = rhs;
 }
Esempio n. 4
0
        public cReport()
        {
            try
            {
                m_headers = new cReportSections();
                m_details = new cReportSections();
                m_footers = new cReportSections();
                m_groups = new cReportGroups();
                m_groupsHeaders = getGroups().getGroupsHeaders();
                m_groupsFooters = getGroups().getGroupsFooters();
                m_paperInfo = new cReportPaperInfo();
                m_controls = new cReportControls2();
                m_formulas = new cReportFormulas();
                m_formulaTypes = new cReportFormulaTypes();
                m_connect = new cReportConnect();
                m_pageSetting = new cReportPageSettings();
                m_pages = new cReportPages();

                m_compiler = new cReportCompiler();

                setConnectsAux(new cReportConnectsAux());

                m_details.setCopyColl(m_controls);
                m_headers.setCopyColl(m_controls);
                m_footers.setCopyColl(m_controls);
                m_groupsHeaders.setCopyColl(m_controls);
                m_groupsFooters.setCopyColl(m_controls);

                m_details.setTypeSection(csRptSectionType.DETAIL);
                m_headers.setTypeSection(csRptSectionType.HEADER);
                m_footers.setTypeSection(csRptSectionType.FOOTER);
                m_groupsHeaders.setTypeSection(csRptSectionType.GROUP_HEADER);
                m_groupsFooters.setTypeSection(csRptSectionType.GROUP_FOOTER);

                m_details.setMainTypeSection(csRptSectionType.MAIN_DETAIL);
                m_headers.setMainTypeSection(csRptSectionType.MAIN_HEADER);
                m_footers.setMainTypeSection(csRptSectionType.MAIN_FOOTER);
            }
            catch (Exception ex)
            {
                cError.mngError(ex, "Class_Initialize", C_MODULE, "");
            }
        }
Esempio n. 5
0
 public void setPaperInfo(cReportPaperInfo rhs)
 {
     m_paperInfo = rhs;
 }
Esempio n. 6
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;
        }