예제 #1
0
파일: Program.cs 프로젝트: jpheary/Argix10
        static void Main(string[] args)
        {
            SubscriptionDataset subs = ReportingGateway.GetSubscriptions();

            System.Diagnostics.Debug.Write(subs.GetXml());
            //string subscriptionID = ReportingGateway.CreateSubscription("0191","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0001","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0006","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0010","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0011","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0023","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0025","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0026","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0031","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0032","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0044","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0046","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0047","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0049","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0055","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0059","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0064","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0065","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0069","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0087","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0101","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0104","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0105","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0107","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0109","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0110","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0113","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0126","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0129","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0130","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0132","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0134","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0139","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0140","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0143","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0145","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0146","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0152","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0189","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0190","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("1017","*****@*****.**");
            //subscriptionID = ReportingGateway.CreateSubscription("0004","*****@*****.**");
        }
예제 #2
0
        public static SubscriptionDataset GetSubscriptions(string reportPath)
        {
            //Get subscriptions  for the specidied report
            SubscriptionDataset subscriptionDataset = new SubscriptionDataset();

            try {
                //Create reporting service web client proxy
                _Client             = new ReportingService2010();
                _Client.Credentials = System.Net.CredentialCache.DefaultCredentials;

                //Request all subscriptions for the specified report
                Subscription[] subscriptions = _Client.ListSubscriptions(reportPath);
                if (subscriptions != null)
                {
                    //Enumerate all subscriptions
                    for (int i = 0; i < subscriptions.Length; i++)
                    {
                        //Get subscription properties
                        Subscription      sub = subscriptions[i];
                        ExtensionSettings extSettings = null;
                        ActiveState       active = null;
                        string            desc = "", status = "", eventType = "", matchData = "";
                        ParameterValue[]  paramValues = null;
                        _Client.GetSubscriptionProperties(subscriptions[i].SubscriptionID, out extSettings, out desc, out active, out status, out eventType, out matchData, out paramValues);

                        string routeDate  = getParamValue(paramValues, "RouteDate");
                        string routeClass = getParamValue(paramValues, "RouteClass");
                        string driverName = getParamValue(paramValues, "DriverName");

                        subscriptionDataset.SubscriptionTable.AddSubscriptionTableRow(sub.Report, sub.SubscriptionID, desc, eventType, sub.LastExecuted, status, active.ToString(), getExtSettings(extSettings), matchData, getParamValues(paramValues), getSubjectLine(extSettings), routeDate, routeClass, driverName);
                    }
                }
            }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { _Client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException(ce.Message); }
            return(subscriptionDataset);
        }