Ejemplo n.º 1
0
        public bool saveData(object commDialog, bool withDialog)
        { // TODO: Use of ByRef founded Public Function SaveData(ByRef CommDialog As Object, Optional ByVal WithDialog As Boolean = True) As Boolean
            CSXml.cXml docXml = null;
            docXml = new CSXml.cXml();

            docXml.init(commDialog);
            docXml.setFilter(C_FILEDATAEX);
            docXml.setName(getFileName(m_name) + "-data.csd");
            docXml.setPath(m_path);

            if (withDialog)
            {
                if (!docXml.newXmlWithDialog())
                {
                    return false;
                }
            }
            else
            {
                if (!docXml.newXml())
                {
                    return false;
                }
            }

            Application.DoEvents();

            cMouseWait mouse = new cMouseWait();
            String dataName = "";
            String dataPath = "";

            dataName = docXml.getName();
            dataPath = docXml.getPath();

            CSXml.cXmlProperty xProperty = null;
            xProperty = new CSXml.cXmlProperty();

            xProperty.setName("RptName");
            xProperty.setValue(eTypes.eText, dataName);
            docXml.addProperty(xProperty);

            // Configuracion de paginas
            XmlNode nodeObj = null;
            XmlNode nodeObjAux = null;

            // Paginas
            cReportPage page = null;

            xProperty.setName(C_NODERPTPAGES);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            for (int _i = 0; _i < m_pages.count(); _i++)
            {
                page = m_pages.item(_i);
                page.save(docXml, nodeObj);
                if (!saveDataForWeb(page, dataName, dataPath))
                {
                    return false;
                }
            }

            if (!docXml.save())
            {
                return false;
            }

            if (!docXml.openXml())
            {
                return false;
            }

            if (!nLoadData(docXml))
            {
                return false;
            }

            mouse.Dispose();

            return true;
        }
Ejemplo n.º 2
0
        private bool saveDataForWeb(cReportPage page, String dataName, String dataPath)
        { // TODO: Use of ByRef founded Private Function SaveDataForWeb(ByRef Page As cReportPage, ByVal DataName As String, ByVal DataPath As String) As Boolean
            CSXml.cXml docXml = null;
            docXml = new CSXml.cXml();

            docXml.init(null);
            docXml.setFilter("xml");
            docXml.setName(getFileName(dataName) + "-1.xml");
            docXml.setPath(dataPath);

            if (!docXml.newXml())
            {
                return false;
            }

            dataName = docXml.getName();

            CSXml.cXmlProperty xProperty = null;
            xProperty = new CSXml.cXmlProperty();

            xProperty.setName("Page_" + page.getPageNumber().ToString());
            xProperty.setValue(eTypes.eText, dataName);
            docXml.addProperty(xProperty);

            XmlNode nodeObj = null;

            xProperty.setName("Page");
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            page.saveForWeb(docXml, nodeObj);

            return docXml.save();
        }
Ejemplo n.º 3
0
        public bool loadData(object commDialog)
        { // TODO: Use of ByRef founded Public Function LoadData(ByRef CommDialog As Object) As Boolean
            CSXml.cXml docXml = null;
            docXml = new CSXml.cXml();

            docXml.init(commDialog);
            docXml.setFilter(C_FILEDATAEX);
            docXml.setName(m_name);
            docXml.setPath(m_path);

            if (!docXml.openXmlWithDialog())
            {
                return false;
            }

            m_path = docXml.getPath();
            m_name = docXml.getName();
            CSXml.cXmlProperty property = docXml.getNodeProperty(docXml.getRootNode(), "ReportDisconnected");
            m_reportDisconnected = property.getValueBool(eTypes.eBoolean);

            return nLoadData(docXml);
        }
Ejemplo n.º 4
0
        public bool loadSilentData(String fileName)
        {
            CSXml.cXml docXml = null;
            docXml = new CSXml.cXml();

            m_path = CSKernelFile.cFile.getPath(fileName);
            m_name = CSKernelFile.cFile.getFileName(fileName);

            docXml.init(null);
            docXml.setFilter(C_FILEDATAEX);
            docXml.setName(m_name);
            docXml.setPath(m_path);

            if (!docXml.openXml())
            {
                return false;
            }

            m_path = docXml.getPath();
            m_name = docXml.getName();

            CSXml.cXmlProperty property = docXml.getNodeProperty(docXml.getRootNode(), "ReportDisconnected");
            m_reportDisconnected = property.getValueBool(eTypes.eBoolean);

            return nLoadData(docXml);
        }
Ejemplo n.º 5
0
        public bool save(object commDialog, bool withDialog)
        { // TODO: Use of ByRef founded Public Function Save(ByRef CommDialog As Object, Optional ByVal WithDialog As Boolean = True) As Boolean
            CSXml.cXml docXml = null;
            docXml = new CSXml.cXml();

            docXml.init(commDialog);
            docXml.setFilter(C_FILEEX);
            docXml.setName(m_name);
            docXml.setPath(m_path);

            if (withDialog)
            {
                if (!docXml.newXmlWithDialog())
                {
                    return false;
                }
            }
            else
            {
                if (!docXml.newXml())
                {
                    return false;
                }
            }

            m_name = docXml.getName();
            m_path = docXml.getPath();

            CSXml.cXmlProperty xProperty = null;
            xProperty = new CSXml.cXmlProperty();

            xProperty.setName("RptName");
            xProperty.setValue(eTypes.eText, m_name);
            docXml.addProperty(xProperty);

            xProperty.setName("ReportDisconnected");
            xProperty.setValue(eTypes.eBoolean, m_reportDisconnected);
            docXml.addProperty(xProperty);

            // sections
            //
            cReportSection sec = null;
            XmlNode nodeObj = null;

            if (!m_connect.save(docXml, null))
            {
                return false;
            }
            if (!m_connectsAux.save(docXml, null))
            {
                return false;
            }
            if (!m_launchInfo.save(docXml, null))
            {
                return false;
            }

            xProperty.setName(C_NODERPTHEADERS);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            for (int _i = 0; _i < m_headers.count(); _i++)
            {
                sec = m_headers.item(_i);
                sec.save(docXml, nodeObj);
            }

            xProperty.setName(C_NODERPTDETAILS);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            for (int _i = 0; _i < m_details.count(); _i++)
            {
                sec = m_details.item(_i);
                sec.save(docXml, nodeObj);
            }

            xProperty.setName(C_NODERPTFOOTERS);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            for (int _i = 0; _i < m_footers.count(); _i++)
            {
                sec = m_footers.item(_i);
                sec.save(docXml, nodeObj);
            }

            xProperty.setName(C_NODEGROUPS);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            cReportGroup group = null;

            for (int _i = 0; _i < m_groups.count(); _i++)
            {
                group = m_groups.item(_i);
                group.save(docXml, nodeObj);
            }

            xProperty.setName(C_NODERPTFORMULAS);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);

            cReportFormula formula = null;
            for (int _i = 0; _i < m_formulas.count(); _i++)
            {
                formula = m_formulas.item(_i);
                if (!formula.getNotSave())
                {
                    formula.save(docXml, nodeObj);
                }
            }

            xProperty.setName(C_NODEPAPERINFO);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = docXml.addNode(xProperty);
            m_paperInfo.save(docXml, nodeObj);

            if (!docXml.save())
            {
                return false;
            }

            if (!docXml.openXml())
            {
                return false;
            }

            if (!nLoad(docXml))
            {
                return false;
            }

            return true;
        }
Ejemplo n.º 6
0
        public bool load(object commDialog)
        { // TODO: Use of ByRef founded Public Function Load(ByRef CommDialog As Object) As Boolean
            try
            {
                CSXml.cXml docXml = null;
                docXml = new CSXml.cXml();

                docXml.init(commDialog);
                docXml.setFilter(C_FILEEX);

                if (m_name != "")
                {
                    docXml.setName(m_name);
                }
                else
                {
                    docXml.setPath(m_pathDefault + "\\*." + C_FILEEX);
                }

                docXml.setPath(m_path);

                if (!docXml.openXmlWithDialog())
                {
                    return false;
                }

                m_path = docXml.getPath();
                m_name = docXml.getName();
                CSXml.cXmlProperty property = docXml.getNodeProperty(docXml.getRootNode(), "ReportDisconnected");
                m_reportDisconnected = property.getValueBool(eTypes.eBoolean);

                return nLoad(docXml);
            }
            catch (Exception ex)
            {
                cError.mngError(ex, "Load", C_MODULE, "");
                return false;
            }
        }
Ejemplo n.º 7
0
        public bool loadSilent(String fileName)
        {

            try
            {
                CSXml.cXml docXml = null;
                docXml = new CSXml.cXml();

                CSKernelFile.cFile f = null;
                f = new CSKernelFile.cFile();

                m_path = cFile.getPath(fileName);
                m_name = cFile.getFileName(fileName);

                docXml.init(null);
                docXml.setFilter(C_FILEEX);
                docXml.setName(m_name);
                docXml.setPath(m_path);

                if (!docXml.openXml())
                {
                    return false;
                }

                m_path = docXml.getPath();
                m_name = docXml.getName();
                CSXml.cXmlProperty property = docXml.getNodeProperty(docXml.getRootNode(), "ReportDisconnected");
                m_reportDisconnected = property.getValueBool(eTypes.eBoolean);

                return nLoad(docXml);
            }
            catch (Exception ex)
            {
                cError.mngError(ex, "LoadSilent", C_MODULE, "");
                return false;
            }
        }