public FormSSRSSItemSelector(ViewItems viewItems) { this.InitializeComponent(); this.viewItem = viewItems; try { this.rs = ReportingServicesFactory.CreateFromSettings(FormSSRSExplorer.SelectedServer, this.tvReportServer, (ToolStripStatusLabel)null, (ListView)null); } catch (Exception ex) { LogHandler.WriteLogEntry(ex); } this.rs.ViewItem = this.viewItem; }
private void Connect() { if (FormSSRSExplorer.SelectedServer != null) { if (string.IsNullOrEmpty(FormSSRSExplorer.SelectedServer.Url)) { this.ShowSelectServer(); } else { try { this.rs = ReportingServicesFactory.CreateFromSettings(FormSSRSExplorer.SelectedServer, this.tvReportServer, this.toolStripStatusLabel, this.lvItems); } catch (Exception ex) { LogHandler.WriteLogEntry(ex); } } try { this.rs.PopulateTreeView(FormSSRSExplorer.SelectedServer.Alias); this.toolStripStatusLabel.Text = string.Format("Connected to {0}", (object)FormSSRSExplorer.SelectedServer.Url); this.Text = "SSRS Explorer - connected to " + FormSSRSExplorer.SelectedServer.Alias; } catch (Exception ex) { this.Text = "SSRS Explorer - not connected"; this.toolStripStatusLabel.Text = "Not connected"; int num = (int)MessageBox.Show("Cannot connect. Check server settings.", "Initialisation failed.", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.rs = (Controller)null; LogHandler.WriteLogEntry(string.Format("Error connecting to {0}:", (object)FormSSRSExplorer.SelectedServer.Url)); LogHandler.WriteLogEntry(ex); } } else { this.ShowSelectServer(); } }