private GenWebAccess.runrepResultsPortfolioStruct runQuery(string queryString)
 {
     string runrepSessionID;
     GenWebAccess.runrepResultsPortfolioStruct selectReturn;
     GenWebAccess.Service webServ = new GenWebAccess.Service();
     webServ.Url = genevaUrl;
     runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
     selectReturn = webServ.RunCallableRunrepRunSelect(runrepSessionID, queryString,"");
     return selectReturn;
 }
 private object runReportLiteral(string ReportName, string Parameters)
 {
     object results;
     string runrepSessionID;
     GenWebAccess.Service webServ = new GenWebAccess.Service();
     webServ.Url = genevaUrl;
     runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
     webServ.RunCallableRunrepReadFile(runrepSessionID, ReportName);
     results = webServ.RunCallableRunrepRunReportLiteral(runrepSessionID, ReportName, Parameters);
     return results;
 }
 private GenWebAccess.reportResultsPortfolioStruct runReport(string ReportName, string Parameters)
 {
     string runrepSessionID;
     GenWebAccess.reportResultsPortfolioStruct selectReturn; ;
     GenWebAccess.Service webServ = new GenWebAccess.Service();
     webServ.Url = genevaUrl;
     runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
     webServ.RunCallableRunrepReadFile(runrepSessionID, ReportName);
     selectReturn = webServ.RunCallableRunrepRunReport(runrepSessionID, ReportName, Parameters);
     return selectReturn;
 }
 private GenWebAccess.runrepListResultsStruct RunrepReportList()
 {
     GenWebAccess.runrepListResultsStruct results;
     string runrepSessionID;
     GenWebAccess.Service webServ = new GenWebAccess.Service();
     webServ.Url = genevaUrl;
     runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
     results = webServ.RunCallableRunrepReportList(runrepSessionID);
     return results;
 }
 private object runReportSelectLiteral(string query)
 {
     object results;
     string runrepSessionID;
     GenWebAccess.Service webServ = new GenWebAccess.Service();
     webServ.Url = genevaUrl;
     runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
     results = webServ.RunCallableRunrepRunSelectLiteral(runrepSessionID, query,"");
     return results;
 }
        public DataSet runReportSelectLiteralDS(string query)
        {
            object results;
            var webServ = new GenWebAccess.Service();
            webServ.Url = genevaUrl;
            webServ.Timeout = 500000;
            string runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
            DataSet tempDS = new DataSet();
            try
            {

                results = webServ.RunCallableRunrepRunSelectLiteral(runrepSessionID, query, "");
                var s = new System.Xml.Serialization.XmlSerializer(typeof(object));
                var writer = new StringWriter();
                s.Serialize(writer, results);
                var reader = new StringReader(writer.ToString());
                tempDS.ReadXml(reader);
               }
            finally
            {
                int i = webServ.ShutdownCallableSession(runrepSessionID);
                webServ.Dispose();
            }
           return tempDS;
        }
        private DataSet RunReportLiteralDS(string ReportName, string Parameters)
        {
            DataSet tempDS = new DataSet();
            object results;
            string runrepSessionID;
            GenWebAccess.Service webServ = new GenWebAccess.Service();
            int i = 0;
            webServ.Url = genevaUrl;
            webServ.Timeout = 500000;
            runrepSessionID = webServ.StartCallableRunrep(genevaPort, genevaHostName, genevaUid, genevaPassword, "-f empty");
            try
            {
                webServ.RunCallableRunrepReadFile(runrepSessionID, ReportName);
                results = webServ.RunCallableRunrepRunReportLiteral(runrepSessionID, ReportName, Parameters);

                System.Xml.Serialization.XmlSerializer s = new System.Xml.Serialization.XmlSerializer(typeof(object));
                StringWriter writer = new StringWriter();
                s.Serialize(writer, results);
                StringReader reader = new StringReader(writer.ToString());
                //Read XML into Dataset
                tempDS.ReadXml(reader);
              

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                i = webServ.ShutdownCallableSession(runrepSessionID);
                webServ.Dispose();
               

            }

          return tempDS;
        }