Example #1
0
        private void moveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormSSRSSItemSelector ssrssItemSelector = new FormSSRSSItemSelector(ViewItems.Folders);

            if (ssrssItemSelector.ShowDialog() != DialogResult.OK || ssrssItemSelector.SelectedItemPath == null)
            {
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            foreach (ListViewItem selectedItem in this.lvItems.SelectedItems)
            {
                try
                {
                    this.rs.MoveItem(selectedItem.ToolTipText, ssrssItemSelector.SelectedItemPath.Trim('/') + "/" + selectedItem.Text, (ReportItemTypes)selectedItem.Tag);
                    this.toolStripStatusLabel.Text = string.Format("Moved item '{0}' to {1}", (object)selectedItem.Text, (object)ssrssItemSelector.SelectedItemPath);
                    Application.DoEvents();
                }
                catch (Exception ex)
                {
                    int num = (int)MessageBox.Show(string.Format("An error has occured: {0}", (object)ex.Message));
                    LogHandler.WriteLogEntry(ex);
                }
            }
            try
            {
                this.rs.PopulateTreeView(FormSSRSExplorer.SelectedServer.Alias);
                this.rs.PopulateItems(this.tvReportServer.SelectedNode.ToolTipText);
            }
            catch (Exception ex)
            {
                LogHandler.WriteLogEntry(ex);
            }
            this.Cursor = Cursors.Default;
        }
Example #2
0
        private void setDatasourceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormSSRSSItemSelector ssrssItemSelector = new FormSSRSSItemSelector(ViewItems.Datasources);

            if (ssrssItemSelector.ShowDialog() != DialogResult.OK || ssrssItemSelector.SelectedItemPath == null)
            {
                return;
            }
            foreach (ListViewItem selectedItem in this.lvItems.SelectedItems)
            {
                try
                {
                    this.rs.SetDatasource(selectedItem.ToolTipText, ssrssItemSelector.SelectedItemPath, (ReportItemTypes)selectedItem.Tag);
                }
                catch (Exception ex)
                {
                    LogHandler.WriteLogEntry(ex);
                }
            }
        }