예제 #1
0
        public override void Execute(object parameter)
        {
            if (parameter == null)
                throw new ArgumentNullException("parameter");
            FileTemplateResult result = (FileTemplateResult)parameter;
            var openedFile = result.NewOpenedFiles.Single();
            var wizardViewModel = new ReportWizardContext();
            var reportWizard = new ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard(wizardViewModel);

            reportWizard.ShowDialog();
            if (reportWizard.DialogResult.HasValue && reportWizard.DialogResult.Value){
                   	LoggingService.Info("ReportWizard - CreateReport");
                var rg = new ReportGenerator();

                rg.Generate(wizardViewModel);
                string xml = CreateFormSheetFromModel.ToXml(rg.ReportModel).ToString();
                openedFile.SetData(Encoding.UTF8.GetBytes(xml));
                if (!openedFile.IsUntitled)
                    openedFile.SaveToDisk();
            } else {
                LoggingService.Info("ReportWizard canceled");
                // HACK: cancel opening the file by clearing the file list
                openedFile.CloseIfAllViewsClosed();
                result.NewOpenedFiles.Clear();
                result.NewFiles.Clear();
            }
        }
예제 #2
0
		public override void Run()
		{
			var wizardViewModel = new ReportWizardContext();
			var reportWizard = new ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard(wizardViewModel);
			
			reportWizard.ShowDialog();
			if (reportWizard.DialogResult.HasValue && reportWizard.DialogResult.Value){
				   	LoggingService.Info("ReportWizard - CreateReport");   
				var rg = new ReportGenerator();
				
				rg.Generate(wizardViewModel);
				ReportModel = rg.ReportModel;
				} else {
				Canceled = true;
			}
		}
예제 #3
0
        public override void Run()
        {
            var wizardViewModel = new ReportWizardContext();
            var reportWizard    = new ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard(wizardViewModel);

            reportWizard.ShowDialog();
            if (reportWizard.DialogResult.HasValue && reportWizard.DialogResult.Value)
            {
                LoggingService.Info("ReportWizard - CreateReport");
                var rg = new ReportGenerator();

                rg.Generate(wizardViewModel);
                ReportModel = rg.ReportModel;
            }
            else
            {
                Canceled = true;
            }
        }