Exemplo n.º 1
0
 /// <summary>
 /// Publishes the reports.
 /// </summary>
 private void PublishBinaryFiles()
 {
     if (_ReportGroups.Length > 0)
     {
         foreach (BinaryFilesGroup reportGroup in _ReportGroups)
         {
             if (reportGroup != null)
             {
                 IWSWrapper   wsWrapper = (IWSWrapper)_WSWrappers[reportGroup.ReportServer.Name];
                 BinaryFile[] reports   = reportGroup.BinaryFiles;
                 if (reports != null && reports.Length > 0)
                 {
                     foreach (BinaryFile report in reports)
                     {
                         if (report != null)
                         {
                             try
                             {
                                 wsWrapper.CreateBinaryFile(reportGroup, report, seq);
                                 seq++;
                             }
                             catch (Exception e)
                             {
                                 Logger.LogException("PublishBinaryFilesTask::PublishReport", e.Message);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 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 = (IWSWrapper)_WSWrappers[source.ReportServer.Name];
                     wsWrapper.CreateDataSource(source);
                     Logger.LogMessage(string.Format("{0} DataSource: [{1}] published successfully", seqDatasource, source.Name));
                     seqDatasource++;
                 }
                 catch (Exception e)
                 {
                     Logger.LogException("PublishTask::CreateDataSource", e.Message);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        public static bool TryCreate(ReportServerInfo reportServer, out IWSWrapper result, out Exception exception)
        {
            ReportingService2005 proxy = new ReportingService2005()
            {
                Url         = reportServer.GetServiceUrl(SERVICE_NAME),
                Timeout     = reportServer.Timeout ?? -1,
                Credentials = reportServer.CreateCredentials(SERVICE_NAME)
            };

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