public FormProperties(string path, ReportItemTypes itemType)
        {
            InitializeComponent();

            controller = ReportingServicesFactory.CreateFromSettings(FormSSRSExplorer.SelectedServer, null, null, null);

            this.path     = path;
            this.itemType = itemType;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="viewItems"></param>
        public FormSSRSSItemSelector(ViewItems viewItems)
        {
            InitializeComponent();
            viewItem = viewItems;

            try
            {
                controller = ReportingServicesFactory.CreateFromSettings(FormSSRSExplorer.SelectedServer, tvReportServer, null, null);
            }
            catch (Exception ex)
            {
                LogHandler.WriteLogEntry(ex);
            }

            controller.ViewItem = viewItem;
        }
        private void Connect()
        {
            if (SelectedServer != null)
            {
                if (String.IsNullOrEmpty(SelectedServer.Url))
                {
                    ShowSelectServer();
                }
                else
                {
                    try
                    {
                        controller = ReportingServicesFactory.CreateFromSettings(SelectedServer, tvReportServer, toolStripStatusLabel, lvItems);
                    }
                    catch (Exception ex)
                    {
                        LogHandler.WriteLogEntry(ex);
                        MessageBox.Show(String.Format("An error has occured: {0}", ex.Message));
                    }
                }

                try
                {
                    controller.PopulateTreeView(SelectedServer.Alias);
                    toolStripStatusLabel.Text = String.Format("Connected to {0}", SelectedServer.Url);

                    Text = "SSRS Explorer - connected to " + SelectedServer.Alias;
                }
                catch (Exception ex)
                {
                    Text = "SSRS Explorer - not connected";

                    toolStripStatusLabel.Text = "Not connected";

                    MessageBox.Show("Cannot connect. Check server settings.", "Initialisation failed.", MessageBoxButtons.OK, MessageBoxIcon.Stop);

                    controller = null;

                    LogHandler.WriteLogEntry(ex, String.Format("Error connecting to {0}:", SelectedServer.Url));
                }
            }
            else
            {
                ShowSelectServer();
            }
        }
Esempio n. 4
0
        public void Initialize()
        {
            var config2005 = new ServerSettingsConfigElement
            {
                SQLServerVersion = "2005",
                Url = "http://dhgwk281:81/ReportServer_sql2012/ReportService2005.asmx",
                IsSharePointMode = false,
                UseWindowsAuth   = true,
            };

            var config2012 = new ServerSettingsConfigElement
            {
                SQLServerVersion = "2012",
                Url = "http://dhgwk281:81/ReportServer_sql2012/ReportService2010.asmx",
                IsSharePointMode = false,
                UseWindowsAuth   = true,
            };

            facade = ReportingServicesFactory.CreateFacadeFromSettings(config2012);

            testFolder = CreateFolder(testFolderName, facade.BaseUrl);
        }