Esempio n. 1
0
        public void GetSqlServerVersion_SQL7()
        {
            SSRSVersion expected = SSRSVersion.SqlServer7;

            SSRSVersion actual = SSRSUtil.GetSqlServerVersion("Microsoft SQL Server Reporting Services Version 7.00.623");

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void GetSqlServerVersion_SQL2000()
        {
            SSRSVersion expected = SSRSVersion.SqlServer2000;

            SSRSVersion actual = SSRSUtil.GetSqlServerVersion("Microsoft SQL Server Reporting Services Version 8.00.194");

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void GetSqlServerVersion_Unknown_BadVersionText()
        {
            SSRSVersion expected = SSRSVersion.Unknown;

            SSRSVersion actual = SSRSUtil.GetSqlServerVersion("Microsoft SQL Serverr Reporting Services Version 16.00.200.8");

            Assert.AreEqual(expected, actual);
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a JSON string that contains a summary of the data created by the ZipBundler.
        /// </summary>
        /// <param name="rootPath">The root path of what is being exported.</param>
        /// <param name="version">The version of SQL Server where the items are being exported from.</param>
        /// <returns>String in JSON format containing the summary of data contained in the zip archive.</returns>
        public string CreateSummary(string rootPath, SSRSVersion version)
        {
            this.mSummary.SourceRootPath = rootPath;
            this.mSummary.SourceVersion  = version;

            // Serialize mEntries Dictionary to JSON format
            string summary = this.mSerializeWrapper.SerializeObject(this.mSummary);

            this.mLogger.Debug("CreateSummary - JSON = {0}", summary);
            this.mLogger.Debug("CreateSummary - Saving summary as '{0}'...", this.mExportSummaryFilename);

            // Add JSON serialized summary string as an entry to the zip using the value from mExportSummaryFilename
            this.mZipFileWrapper.AddEntry(this.mExportSummaryFilename, summary);

            return(summary);
        }
Esempio n. 5
0
        private void bw_ExportItems_Completed(object sender, RunWorkerCompletedEventArgs e)
        {
            string msg = null;

            if ((e.Cancelled == true))
            {
                msg = string.Format("Cancelled. {0}", e.Result);
            }
            else if ((e.Error != null))
            {
                msg = string.Format("Error. {0}", e.Error);

                this.mLogger.Error(e.Error, "Error during export");

                this.mDebugForm.LogMessage(msg, e.Error);

                MessageBox.Show(msg,
                                "Export Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
            else
            {
                msg = string.Format("Completed. {0}", e.Result);

                // If the export completed, create the summary and save the ZipBundler
                string      sourceRootPath = this.mSourceRootPath;
                SSRSVersion sourceVersion  = this.mReportServerReader.GetSqlServerVersion();
                this.mZipBundler.CreateSummary(sourceRootPath, sourceVersion);

                string filename = this.mZipBundler.Save(this.mExportDestinationFilename);

                this.mLogger.Info("ExportedItemsCompleted - Saved zip bundle to '{0}'.", filename);
                this.mDebugForm.LogMessage(string.Format("Saved zip bundle to '{0}'.", filename));
            }

            this.mLogger.Info("Export completed: {0}", msg);
            this.lblStatus.Text = msg;
            this.btnSrcRefreshReports.Enabled = true;
            this.btnExport.Enabled            = true;
            this.lblStatus.Text = msg;

            this.mSummaryForm.ShowDialog();
        }
Esempio n. 6
0
        private void DirectMigration_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();
            this.Save_DestinationConfiguration();

            IReportServerReader reader = null;
            IReportServerWriter writer = null;
            string srcVersion          = "2005-SRC";
            string destVersion         = "2005-SRC";

            if (this.cboSrcVersion.SelectedIndex > this.cboDestVersion.SelectedIndex)
            {
                throw new Exception("Source server is newer than destination server.");
            }

            if (this.cboSrcVersion.SelectedIndex == 0)
            {
                srcVersion = "2005-SRC";
            }
            else
            {
                srcVersion = "2010-SRC";
            }

            if (this.cboDestVersion.SelectedIndex == 0)
            {
                destVersion = "2005-DEST";
            }
            else
            {
                destVersion = "2010-DEST";
            }

            // If source server is the same as the destination server and the root paths are the same, throw exception
            if (this.txtSrcUrl.Text.ToLower() == this.txtDestUrl.Text.ToLower() &&
                this.txtSrcPath.Text.ToLower() == this.txtDestPath.Text.ToLower())
            {
                throw new Exception("You cannot migrate to the same path on the same server.");
            }

            // Test the source connection
            this.TestSourceConnection(true);

            // Test the destination connection
            this.TestDestinationConnection(true);

            reader = this.mKernel.Get <IReportServerReader>(srcVersion);
            writer = this.mKernel.Get <IReportServerWriter>(destVersion);

            // Check source and destination server versions through the reader and writer
            SSRSVersion sourceVersion      = reader.GetSqlServerVersion();
            SSRSVersion destinationVersion = writer.GetSqlServerVersion();

            // If the destination version is older than the source version, prevent migration.
            if ((int)destinationVersion < (int)sourceVersion)
            {
                throw new Exception("Destination server is using an older version of SQL Server than the source server.");
            }

            writer.Overwrite = this.cbkDestOverwrite.Checked;

            // Resolve PythonEngine from kernel
            PythonEngine engine = this.mKernel.Get <PythonEngine>(destVersion);

            this.PerformDirectMigrate(
                this.txtSrcUrl.Text,
                this.txtSrcPath.Text,
                this.txtDestUrl.Text,
                this.txtDestPath.Text,
                reader,
                writer,
                engine);
        }
Esempio n. 7
0
        /// <summary>
        /// Creates a JSON string that contains a summary of the data created by the ZipBundler.
        /// </summary>
        /// <param name="rootPath">The root path of what is being exported.</param>
        /// <param name="version">The version of SQL Server where the items are being exported from.</param>
        /// <returns>String in JSON format containing the summary of data contained in the zip archive.</returns>
        public string CreateSummary(string rootPath, SSRSVersion version)
        {
            this.mSummary.SourceRootPath = rootPath;
            this.mSummary.SourceVersion = version;

            // Serialize mEntries Dictionary to JSON format
            string summary = this.mSerializeWrapper.SerializeObject(this.mSummary);

            this.mLogger.Debug("CreateSummary - JSON = {0}", summary);
            this.mLogger.Debug("CreateSummary - Saving summary as '{0}'...", this.mExportSummaryFilename);

            // Add JSON serialized summary string as an entry to the zip using the value from mExportSummaryFilename
            this.mZipFileWrapper.AddEntry(this.mExportSummaryFilename, summary);

            return summary;
        }