コード例 #1
0
        private void CreateDesigner(string relativeReportBasePath)
        {
            DesignForm = CreateDesignForm();
            var controller = DesignForm.DesignMdiController;

            // Hide Scripting & HTML Preview
            controller.SetCommandVisibility(ReportCommand.ShowScriptsTab, CommandVisibility.None);
            controller.SetCommandVisibility(ReportCommand.ShowHTMLViewTab, CommandVisibility.None);

            // Use ReportController during PrintPreview
            this.UseReportControllerDuringPrintPreview();

            // Pass Datasource to Subreports
            this.SetupDesignTimeSubreportDatasourcePassing();

            // Add toolbar button to select Datasource
            AddToolbarButton_SelectDataSource(DesignForm);

            // Relative Path ReportSourceURL (Sad this is static/global.  Bad Design, DevExpress.)
            var relativePathStorage = new RelativePathReportStorage(relativeReportBasePath);
            ReportStorageExtension.RegisterExtensionGlobal(relativePathStorage);
        }
        private void Init(string _reportsRelativeBasePath)
        {
            //var outFolder = TestContext.DeploymentDirectory;        // Visual Studio Tests
            var outFolder = TestContext.CurrentContext.TestDirectory; // NUnit

            applicationBasePath = outFolder;

            reportsRelativeBasePath = _reportsRelativeBasePath;
            reportsFullBasePath = Path.Combine(applicationBasePath, reportsRelativeBasePath);

            // Clear Folder
            if (Directory.Exists(reportsFullBasePath))
                Directory.Delete(reportsFullBasePath, true);

            // Create Folder
            Directory.CreateDirectory(reportsFullBasePath);

            // Create Report
            report1 = new XtraReport() { Name = "Report1" };
            report1RelativePath = "Report1.resx";
            report1FullPath = Path.Combine(reportsFullBasePath, report1RelativePath);

            // Create Storage Extension
            storage = new RelativePathReportStorage(reportsRelativeBasePath);
        }