Example #1
0
        protected override QlikViewReport CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            QlikViewReport report = new QlikViewReport();

            report.Name                   = xmlNode.GetAttributeValueIf("Name");
            report.Description            = xmlNode.GetAttributeValueIf("Description");
            report.OutputFielName         = xmlNode.GetNodeValueIf("OutputFileName");
            report.EnableDynamicNaming    = bool.Parse(xmlNode.GetNodeValueIf("EnableDynamicNaming"));
            report.IsEmbeddedInMail       = bool.Parse(xmlNode.GetNodeValueIf("EmbeddedInMail"));
            report.QlikViewExportObjectId = xmlNode.GetNodeValueIf("QlikViewExportObjectId");
            report.ReportType             = (ReportType)int.Parse(xmlNode.GetNodeValueIf("ReportType"));

            string connection = xmlNode.GetNodeValueIf("Connection");

            if (ReportConfig.ConnectionManager.ItemCollection.ContainsKey(connection))
            {
                report.Connection = ReportConfig.ConnectionManager.ItemCollection[connection];
            }

            string filter = xmlNode.GetNodeValueIf("Filter");

            if (ReportConfig.FilterManager.ItemCollection.ContainsKey(filter))
            {
                report.Filter = ReportConfig.FilterManager.ItemCollection[filter];
            }

            return(report);
        }
Example #2
0
        protected override ReportTask CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            ReportTask task = new ReportTask();

            task.Name                   = xmlNode.GetAttributeValueIf("Name");
            task.Description            = xmlNode.GetAttributeValueIf("Description");
            task.OutputFolder           = xmlNode.GetNodeValueIf("OutputFolder");
            task.IsSendMailInSingleMail = bool.Parse(xmlNode.GetNodeValueIf("SendInSingleMail"));
            task.IsMergeInSingleExcel   = bool.Parse(xmlNode.GetNodeValueIf("MergeInSingleExcel"));

            XmlNodeList reportNodeList = xmlNode.SelectNodes("Reports/Report");

            for (int i = 0; i < reportNodeList.Count; i++)
            {
                string report = reportNodeList[i].GetNodeValueIf();
                if (ReportConfig.QvReportManager.ItemCollection.ContainsKey(report))
                {
                    var qvReport = ReportConfig.QvReportManager.ItemCollection[report];
                    task.Reports.Add(report, qvReport);
                }
            }

            XmlNodeList recipientNodeList = xmlNode.SelectNodes("Recipients/Recipient");

            for (int i = 0; i < recipientNodeList.Count; i++)
            {
                string recipient = recipientNodeList[i].GetNodeValueIf();
                if (ReportConfig.RecipientManager.ItemCollection.ContainsKey(recipient))
                {
                    task.Recipients.Add(recipient, ReportConfig.RecipientManager.ItemCollection[recipient]);
                }
            }

            string recipientGroup = xmlNode.GetNodeValueIf("RecipientGroup");

            if (ReportConfig.RecipientGroupManager.ItemCollection.ContainsKey(recipientGroup))
            {
                task.Group = ReportConfig.RecipientGroupManager.ItemCollection[recipientGroup];
            }

            task.MessageDefinition         = new Message();
            task.MessageDefinition.From    = xmlNode.GetNodeValueIf("Message/From");
            task.MessageDefinition.CC      = xmlNode.GetNodeValueIf("Message/CC");
            task.MessageDefinition.BCC     = xmlNode.GetNodeValueIf("Message/BCC");
            task.MessageDefinition.Subject = xmlNode.GetNodeValueIf("Message/Subject");
            task.MessageDefinition.Body    = xmlNode.GetNodeValueIf("Message/Body");

            if (xmlNode.ChildNodeExists("FtpServer"))
            {
                task.FtpServer          = new FtpServer();
                task.FtpServer.Host     = xmlNode.GetNodeValueIf("FtpServer/Host");
                task.FtpServer.Username = xmlNode.GetNodeValueIf("FtpServer/Username");
                task.FtpServer.Password = EncryptionDecryption.Decode(xmlNode.GetNodeValueIf("FtpServer/Password"));
                task.FtpServer.Folder   = xmlNode.GetNodeValueIf("FtpServer/Folder");
                task.FtpServer.Port     = xmlNode.GetNodeValueIf("FtpServer/Port");
            }
            return(task);
        }
Example #3
0
        protected override Recipient CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            Recipient recipient = new Recipient();

            recipient.Name        = xmlNode.GetAttributeValueIf("Name");
            recipient.Description = xmlNode.GetAttributeValueIf("Description");
            recipient.Email       = xmlNode.GetNodeValueIf("Email");
            recipient.EmailCC     = xmlNode.GetNodeValueIf("EmailCC");

            return(recipient);
        }
Example #4
0
        protected override ReportConnection CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            ReportConnection connection = new ReportConnection();

            connection.Name             = xmlNode.GetAttributeValueIf("Name");
            connection.Description      = xmlNode.GetAttributeValueIf("Description");
            connection.IsLocal          = bool.Parse(xmlNode.GetNodeValueIf("IsLocal"));
            connection.QlikViewDocument = xmlNode.GetNodeValueIf("QlikViewDocument");
            connection.ServerName       = xmlNode.GetNodeValueIf("ServerName");
            connection.ServiceHost      = xmlNode.GetNodeValueIf("WebServiceHost");
            connection.ServicePort      = xmlNode.GetNodeValueIf("WebServicePort");
            connection.User             = xmlNode.GetNodeValueIf("User");
            connection.Password         = EncryptionDecryption.Decode(xmlNode.GetNodeValueIf("Password"));

            return(connection);
        }
Example #5
0
        protected override Filter CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            Filter filter = new Filter();

            filter.Name        = xmlNode.GetAttributeValueIf("Name");
            filter.Description = xmlNode.GetAttributeValueIf("Description");
            string connection = xmlNode.GetNodeValueIf("Connection");

            if (ReportConfig.ConnectionManager.ItemCollection.ContainsKey(connection))
            {
                filter.Connection = ReportConfig.ConnectionManager.ItemCollection[connection];
            }

            XmlNodeList list = xmlNode.SelectNodes("Fields/Field");

            for (int i = 0; i < list.Count; i++)
            {
                QVField field = new QVField();
                field.Name       = list[i].GetAttributeValueIf("Name");
                field.Expression = list[i].GetAttributeValueIf("Expression");
                XmlNodeList valueList = list[i].SelectNodes("Value");
                for (int j = 0; j < valueList.Count; j++)
                {
                    FieldValue value = new FieldValue();
                    value.Value     = valueList[j].GetNodeValueIf();
                    value.Number    = double.Parse(valueList[j].GetAttributeValueIf("Number"));
                    value.IsNumeric = bool.Parse(valueList[j].GetAttributeValueIf("IsNumeric"));
                    field.Values.Add(value);
                }

                filter.Fields.Add(field.Name, field);
            }

            list = xmlNode.SelectNodes("Variables/Variable");
            for (int i = 0; i < list.Count; i++)
            {
                QvVariable variable = new QvVariable();
                variable.Name       = list[i].GetAttributeValueIf("Name");
                variable.Expression = list[i].GetAttributeValueIf("Expression");
                variable.Value      = list[i].GetNodeValueIf();

                filter.Variables.Add(variable.Name, variable);
            }

            return(filter);
        }
Example #6
0
        protected override RecipientGroup CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            RecipientGroup group = new RecipientGroup();

            group.Name        = xmlNode.GetAttributeValueIf("Name");
            group.Description = xmlNode.GetAttributeValueIf("Description");

            XmlNodeList recipientNodeList = xmlNode.SelectNodes("Recipient");

            for (int i = 0; i < recipientNodeList.Count; i++)
            {
                string recipient = recipientNodeList[i].GetNodeValueIf();
                if (ReportConfig.RecipientManager.ItemCollection.ContainsKey(recipient))
                {
                    group.RecipientList.Add(recipient, ReportConfig.RecipientManager.ItemCollection[recipient]);
                }
            }

            return(group);
        }
Example #7
0
        protected override ReportSchedulerDefinition CreateItemFromXmlNode(System.Xml.XmlNode xmlNode)
        {
            ReportSchedulerDefinition scheduler = new ReportSchedulerDefinition();

            scheduler.Name        = xmlNode.GetAttributeValueIf("Name");
            scheduler.Description = xmlNode.GetAttributeValueIf("Description");
            //scheduler.ScheduleType = (ScheduleType)int.Parse(xmlNode.GetNodeValueIf("SchedulerType"));
            //scheduler.StartDate = DateTime.Parse(xmlNode.GetNodeValueIf("StartDate"));
            //scheduler.ShotTime = DateTime.Parse(xmlNode.GetNodeValueIf("ShotTime"));

            XmlNodeList taskNodeList = xmlNode.SelectNodes("Tasks/Task");

            for (int i = 0; i < taskNodeList.Count; i++)
            {
                string task = taskNodeList[i].GetNodeValueIf();
                if (ReportConfig.ReportTaskManager.ItemCollection.ContainsKey(task))
                {
                    scheduler.Tasks.Add(task, ReportConfig.ReportTaskManager.ItemCollection[task]);
                }
            }

            return(scheduler);
        }