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(); } }