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; }
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(); }
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; }