Esempio n. 1
0
        public string CreateSubscription(SubscritionValues subscrition)
        {
            ReportingService2010 rs = new ReportingService2010();
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
            string report = subscrition.Report;
            string desc = System.Net.CredentialCache.DefaultCredentials +
                            " subscribed " + subscrition.Report + " to EMAIL";
            string eventType = "TimedSubscription";
            string scheduleXml = getScheduleXML(subscrition);

            ParameterValue[] extensionParams = new ParameterValue[7];

            extensionParams[0] = new ParameterValue();
            extensionParams[0].Name = "RenderFormat";
            extensionParams[0].Value = "PDF";

            extensionParams[1] = new ParameterValue();
            extensionParams[1].Name = "TO";
            extensionParams[1].Value = subscrition.TO;

            extensionParams[2] = new ParameterValue();
            extensionParams[2].Name = "IncludeReport";
            extensionParams[2].Value = "true";

            extensionParams[3] = new ParameterValue();
            extensionParams[3].Name = "Subject";
            extensionParams[3].Value = subscrition.Subject;

            extensionParams[4] = new ParameterValue();
            extensionParams[4].Name = "IncludeLink";
            extensionParams[4].Value = "true";

            extensionParams[5] = new ParameterValue();
            extensionParams[5].Name = "CC";
            extensionParams[5].Value = subscrition.CC;

            extensionParams[6] = new ParameterValue();
            extensionParams[6].Name = "BCC";
            extensionParams[6].Value = subscrition.BCC;

            string matchData = scheduleXml;
            ExtensionSettings extSettings = new ExtensionSettings();
            extSettings.ParameterValues = extensionParams;
            extSettings.Extension = "Report Server Email";

            ParameterValue[] parameters = new ParameterValue[subscrition.Parameters.Length];
            for (int i = 0; i < subscrition.Parameters.Length;i++ )
            {
                ParameterValue parameter = new ParameterValue();
                parameter.Name = subscrition.Parameters[i].ParameterName;
                parameter.Value = subscrition.Parameters[i].ParameterValue;
                parameters[i] = parameter;

            }
            try
            {
               string subscriptionID =rs.CreateSubscription(report, extSettings, desc,
                    eventType, matchData, parameters);
               Dips_progression_subscription ps = new Dips_progression_subscription();
               ps.indicator = subscrition.ConditionIndicator;
               ps.location = subscrition.ConditionLocation;
               ps.operand = subscrition.ConditionOperand;
               if (subscrition.ConditionValue!=null && subscrition.ConditionValue != "")
                ps.value = Double.Parse(subscrition.ConditionValue);
               ps.subscription_id = subscriptionID;
               ps.last_updated_date = DateTime.Now;
               ps.status = "Added";
               if (ps.indicator != null)
               {
                   db.Dips_progression_subscription.Add(ps);
                   db.SaveChanges();
               }
               return subscriptionID;
            }

            catch (SoapException e)
            {
                Console.WriteLine(e.Message);
                return "Subscribe failed "+e.Message;
            }
        }
Esempio n. 2
0
 /// <remarks/>
 public void CreateDataDrivenSubscriptionAsync(string ItemPath, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, string Description, string EventType, string MatchData, ParameterValueOrFieldReference[] Parameters) {
     this.CreateDataDrivenSubscriptionAsync(ItemPath, ExtensionSettings, DataRetrievalPlan, Description, EventType, MatchData, Parameters, null);
 }
Esempio n. 3
0
 /// <remarks/>
 public void CreateDataDrivenSubscriptionAsync(string ItemPath, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, string Description, string EventType, string MatchData, ParameterValueOrFieldReference[] Parameters, object userState) {
     if ((this.CreateDataDrivenSubscriptionOperationCompleted == null)) {
         this.CreateDataDrivenSubscriptionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDataDrivenSubscriptionOperationCompleted);
     }
     this.InvokeAsync("CreateDataDrivenSubscription", new object[] {
                 ItemPath,
                 ExtensionSettings,
                 DataRetrievalPlan,
                 Description,
                 EventType,
                 MatchData,
                 Parameters}, this.CreateDataDrivenSubscriptionOperationCompleted, userState);
 }
Esempio n. 4
0
 /// <remarks/>
 public void CreateSubscriptionAsync(string ItemPath, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.CreateSubscriptionAsync(ItemPath, ExtensionSettings, Description, EventType, MatchData, Parameters, null);
 }
Esempio n. 5
0
 public string CreateDataDrivenSubscription(string ItemPath, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, string Description, string EventType, string MatchData, ParameterValueOrFieldReference[] Parameters) {
     object[] results = this.Invoke("CreateDataDrivenSubscription", new object[] {
                 ItemPath,
                 ExtensionSettings,
                 DataRetrievalPlan,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
     return ((string)(results[0]));
 }
Esempio n. 6
0
 public string GetDataDrivenSubscriptionProperties(string DataDrivenSubscriptionID, out ExtensionSettings ExtensionSettings, out DataRetrievalPlan DataRetrievalPlan, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValueOrFieldReference[] Parameters) {
     object[] results = this.Invoke("GetDataDrivenSubscriptionProperties", new object[] {
                 DataDrivenSubscriptionID});
     ExtensionSettings = ((ExtensionSettings)(results[1]));
     DataRetrievalPlan = ((DataRetrievalPlan)(results[2]));
     Description = ((string)(results[3]));
     Active = ((ActiveState)(results[4]));
     Status = ((string)(results[5]));
     EventType = ((string)(results[6]));
     MatchData = ((string)(results[7]));
     Parameters = ((ParameterValueOrFieldReference[])(results[8]));
     return ((string)(results[0]));
 }
Esempio n. 7
0
 public string CreateSubscription(string ItemPath, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     object[] results = this.Invoke("CreateSubscription", new object[] {
                 ItemPath,
                 ExtensionSettings,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
     return ((string)(results[0]));
 }
Esempio n. 8
0
 /// <remarks/>
 public void SetDataDrivenSubscriptionPropertiesAsync(string DataDrivenSubscriptionID, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, string Description, string EventType, string MatchData, ParameterValueOrFieldReference[] Parameters) {
     this.SetDataDrivenSubscriptionPropertiesAsync(DataDrivenSubscriptionID, ExtensionSettings, DataRetrievalPlan, Description, EventType, MatchData, Parameters, null);
 }
Esempio n. 9
0
 public void SetDataDrivenSubscriptionProperties(string DataDrivenSubscriptionID, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, string Description, string EventType, string MatchData, ParameterValueOrFieldReference[] Parameters) {
     this.Invoke("SetDataDrivenSubscriptionProperties", new object[] {
                 DataDrivenSubscriptionID,
                 ExtensionSettings,
                 DataRetrievalPlan,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
 }
Esempio n. 10
0
 /// <remarks/>
 public void SetSubscriptionPropertiesAsync(string SubscriptionID, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters, object userState) {
     if ((this.SetSubscriptionPropertiesOperationCompleted == null)) {
         this.SetSubscriptionPropertiesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSubscriptionPropertiesOperationCompleted);
     }
     this.InvokeAsync("SetSubscriptionProperties", new object[] {
                 SubscriptionID,
                 ExtensionSettings,
                 Description,
                 EventType,
                 MatchData,
                 Parameters}, this.SetSubscriptionPropertiesOperationCompleted, userState);
 }
Esempio n. 11
0
 /// <remarks/>
 public void SetSubscriptionPropertiesAsync(string SubscriptionID, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.SetSubscriptionPropertiesAsync(SubscriptionID, ExtensionSettings, Description, EventType, MatchData, Parameters, null);
 }
Esempio n. 12
0
 public void SetSubscriptionProperties(string SubscriptionID, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.Invoke("SetSubscriptionProperties", new object[] {
                 SubscriptionID,
                 ExtensionSettings,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
 }