예제 #1
0
        /// <summary>
        /// Publishes the reports.
        /// </summary>
        private void PublishReports()
        {
            foreach (ReportGroup reportGroup in _reportGroups)
            {
                if (reportGroup != null)
                {
                    IWsWrapper wsWrapper = _wsWrappers[reportGroup.ReportServer.Name];

                    foreach (Report report in reportGroup.Reports)
                    {
                        if (report != null)
                        {
                            try
                            {
                                byte[] reportDefinition = Encoding.UTF8.GetBytes(report.Definition);
                                wsWrapper.CreateReport(report, report.TargetFolder, reportDefinition);
                            }
                            catch (Exception e)
                            {
                                Logger.LogException("PublishTask::PublishReport", e.Message);
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Creates the data sources.
 /// </summary>
 private void CreateDataSources()
 {
     if (_dataSources != null && _dataSources.Count > 0)
     {
         foreach (DataSource source in _dataSources.Values)
         {
             if (source.Publish && source.ReportServer != null)
             {
                 try
                 {
                     IWsWrapper wsWrapper = _wsWrappers[source.ReportServer.Name];
                     wsWrapper.CreateDataSource(source);
                     Logger.LogMessage(string.Format("DataSource: [{0}] published successfully", source.Name));
                 }
                 catch (Exception e)
                 {
                     Logger.LogException("PublishTask::CreateDataSource", e.Message);
                 }
             }
         }
     }
 }
예제 #3
0
        public static bool TryCreate(ReportServerInfo reportServer, out IWsWrapper result, out Exception exception)
        {
            RS.ReportingService proxy = new RS.ReportingService
            {
                Url         = reportServer.GetServiceUrl(SERVICE_NAME),
                Timeout     = reportServer.Timeout ?? -1,
                Credentials = reportServer.CreateCredentials(SERVICE_NAME)
            };

            try
            {
                proxy.ListSecureMethods();
                result    = new WsWrapper2003(proxy);
                exception = null;
                return(true);
            }
            catch (Exception e)
            {
                proxy.Dispose();
                result    = null;
                exception = e;
                return(false);
            }
        }