public static void setParametersAux(cConnect connect, cReportConnect rptConnect) { rptConnect.getColumns().clear(); rptConnect.getParameters().clear(); for (int i = 0; i < connect.getColumnsInfo().count(); i++) { CSConnect.cColumnInfo colInfo = connect.getColumnsInfo().item(i); CSReportDll.cColumnInfo rptColInfo = new CSReportDll.cColumnInfo(); rptColInfo.setName(colInfo.getName()); rptColInfo.setPosition(colInfo.getPosition()); rptColInfo.setColumnType(colInfo.getColumnType()); rptConnect.getColumns().add(rptColInfo, ""); } for (int i = 0; i < connect.getParameters().count(); i++) { CSConnect.cParameter parameter = connect.getParameters().item(i); CSReportDll.cParameter rptParameter = new CSReportDll.cParameter(); rptParameter.setName(parameter.getName()); rptParameter.setPosition(parameter.getPosition()); rptParameter.setColumnType(parameter.getColumnType()); rptParameter.setValue(parameter.getValue()); rptConnect.getParameters().add(rptParameter, ""); } }
public cParameter add(cParameter c, String key) { try { if (c == null) { c = new cParameter(); } if (key == "") { key = cReportGlobals.getKey(cReportGlobals.getNextKey().ToString()); } else { cReportGlobals.refreshNextKey(key); key = cReportGlobals.getKey(key); } c.setPosition(this.Count); c.setKey(key); Add(key, c); return(c); } catch (Exception ex) { return(null); } }
internal bool save(CSXml.cXml xDoc, XmlNode nodeFather) { CSXml.cXmlProperty xProperty = null; XmlNode nodeObj = null; XmlNode nodeObjAux = null; xProperty = new CSXml.cXmlProperty(); xProperty.setName(C_RPTCONNECT); if (nodeFather != null) { nodeObj = xDoc.addNodeToNode(nodeFather, xProperty); } else { nodeObj = xDoc.addNode(xProperty); } xProperty.setName("DataSource"); xProperty.setValue(eTypes.eText, m_dataSource); xDoc.addPropertyToNode(nodeObj, xProperty); xProperty.setName("DataSourceType"); xProperty.setValue(eTypes.eInteger, m_dataSourceType); xDoc.addPropertyToNode(nodeObj, xProperty); xProperty.setName("StrConnect"); xProperty.setValue(eTypes.eText, m_strConnect); xDoc.addPropertyToNode(nodeObj, xProperty); nodeObjAux = nodeObj; xProperty.setName(C_RPTCOLUMNS); nodeObj = xDoc.addNodeToNode(nodeObj, xProperty); cColumnInfo col = null; for (int _i = 0; _i < m_columns.count(); _i++) { col = m_columns.item(_i); if (!col.save(xDoc, nodeObj)) { return(false); } } nodeObj = nodeObjAux; xProperty.setName(C_RPTPARAMETERS); nodeObj = xDoc.addNodeToNode(nodeObj, xProperty); cParameter param = null; for (int _i = 0; _i < m_parameters.count(); _i++) { param = m_parameters.item(_i); if (!param.save(xDoc, nodeObj)) { return(false); } } return(true); }
public String getSqlParameters() { String s = ""; cParameter param = null; for (int _i = 0; _i < m_parameters.count(); _i++) { param = m_parameters.item(_i); switch (param.getColumnType()) { case csDataType.CSTDWCHAR: /* * case csDataType.CSTDVARWCHAR: * case csDataType.CSTDVARCHAR: * case csDataType.CSTDLONGVARWCHAR: * case csDataType.CSTDLONGVARCHAR: * case csDataType.CSTDCHAR: */ s += cDataBase.sqlString(param.getValue()) + ","; break; case csDataType.CSTDTINYINT: case csDataType.CSTDUNSIGNEDTINYINT: case csDataType.CSTDSMALLINT: case csDataType.CSTDSINGLE: case csDataType.CSTDNUMERIC: case csDataType.CSTDINTEGER: case csDataType.CSTDDOUBLE: /* * case csDataType.CSTDDECIMAL: * case csDataType.CSTDCURRENCY: */ case csDataType.CSTDBOOLEAN: case csDataType.CSTDBIGINT: s += cDataBase.sqlNumber(param.getValue()) + ","; break; case csDataType.CSTDDBTIMESTAMP: /* * case csDataType.CSTDDBTIME: * case csDataType.CSTDDBDATE: * case csDataType.CSTDDATE: */ s += cDataBase.sqlDate(param.getValue()) + ","; break; default: cWindow.msgWarning("This data type is not codified " + param.getColumnType() + ". Parameter: " + param.getName() + ". Function: sqlParameters."); break; } } if (s.Length > 0 && s.Substring(s.Length - 1) == ",") { s = s.Substring(0, s.Length - 1); } return(s); }
public cParameter add(cParameter c, String key) { try { if (c == null) { c = new cParameter(); } if (key == "") { key = cReportGlobals.getKey(cReportGlobals.getNextKey().ToString()); } else { cReportGlobals.refreshNextKey(key); key = cReportGlobals.getKey(key); } c.setPosition(this.Count); c.setKey(key); Add(key, c); return c; } catch (Exception ex) { return null; } }