Esempio n. 1
0
        public void SetHTMLReportConfigurationWithDefaultValues(HTMLReportConfiguration reportConfiguraion)
        {
            reportConfiguraion.ReportLowerLevelToShow            = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            reportConfiguraion.ExecutionJsonDataLowerLevelToShow = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            reportConfiguraion.ShowAllIterationsElements         = false;
            reportConfiguraion.UseLocalStoredStyling             = false;
            reportConfiguraion.RunSetFieldsToSelect           = GetReportLevelMembers(typeof(RunSetReport));
            reportConfiguraion.EmailSummaryViewFieldsToSelect = GetReportLevelMembers(typeof(RunSetReport));
            reportConfiguraion.GingerRunnerFieldsToSelect     = GetReportLevelMembers(typeof(GingerReport));
            reportConfiguraion.BusinessFlowFieldsToSelect     = GetReportLevelMembers(typeof(BusinessFlowReport));
            reportConfiguraion.ActivityGroupFieldsToSelect    = GetReportLevelMembers(typeof(ActivityGroupReport));
            reportConfiguraion.ActivityFieldsToSelect         = GetReportLevelMembers(typeof(ActivityReport));
            reportConfiguraion.ActionFieldsToSelect           = GetReportLevelMembers(typeof(ActionReport));

            reportConfiguraion.RunSetSourceFieldsToSelect        = GetReportLevelMembers(typeof(LiteDbRunSet), true);
            reportConfiguraion.GingerRunnerSourceFieldsToSelect  = GetReportLevelMembers(typeof(LiteDbRunner), true);
            reportConfiguraion.BusinessFlowSourceFieldsToSelect  = GetReportLevelMembers(typeof(LiteDbBusinessFlow), true);
            reportConfiguraion.ActivityGroupSourceFieldsToSelect = GetReportLevelMembers(typeof(LiteDbActivityGroup), true);
            reportConfiguraion.ActivitySourceFieldsToSelect      = GetReportLevelMembers(typeof(LiteDbActivity), true);
            reportConfiguraion.ActionSourceFieldsToSelect        = GetReportLevelMembers(typeof(LiteDbAction), true);

            reportConfiguraion.Description = string.Empty;
            using (var ms = new MemoryStream())
            {
                string file   = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Images", "@amdocs_logo.jpg");
                Bitmap bitmap = new Bitmap(file);
                reportConfiguraion.LogoBase64Image = HTMLReportConfiguration.BitmapToBase64(bitmap);
            }
        }
Esempio n. 2
0
        public void SetHTMLReportConfigurationWithDefaultValues(HTMLReportConfiguration reportConfiguraion)
        {
            reportConfiguraion.ReportLowerLevelToShow         = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            reportConfiguraion.ShowAllIterationsElements      = false;
            reportConfiguraion.UseLocalStoredStyling          = false;
            reportConfiguraion.RunSetFieldsToSelect           = GetReportLevelMembers(typeof(RunSetReport));
            reportConfiguraion.EmailSummaryViewFieldsToSelect = GetReportLevelMembers(typeof(RunSetReport));
            reportConfiguraion.GingerRunnerFieldsToSelect     = GetReportLevelMembers(typeof(GingerReport));
            reportConfiguraion.BusinessFlowFieldsToSelect     = GetReportLevelMembers(typeof(BusinessFlowReport));
            reportConfiguraion.ActivityGroupFieldsToSelect    = GetReportLevelMembers(typeof(ActivityGroupReport));
            reportConfiguraion.ActivityFieldsToSelect         = GetReportLevelMembers(typeof(ActivityReport));
            reportConfiguraion.ActionFieldsToSelect           = GetReportLevelMembers(typeof(ActionReport));

            reportConfiguraion.RunSetSourceFieldsToSelect        = GetReportLevelMembers(typeof(LiteDbRunSet), true);
            reportConfiguraion.GingerRunnerSourceFieldsToSelect  = GetReportLevelMembers(typeof(LiteDbRunner), true);
            reportConfiguraion.BusinessFlowSourceFieldsToSelect  = GetReportLevelMembers(typeof(LiteDbBusinessFlow), true);
            reportConfiguraion.ActivityGroupSourceFieldsToSelect = GetReportLevelMembers(typeof(LiteDbActivityGroup), true);
            reportConfiguraion.ActivitySourceFieldsToSelect      = GetReportLevelMembers(typeof(LiteDbActivity), true);
            reportConfiguraion.ActionSourceFieldsToSelect        = GetReportLevelMembers(typeof(LiteDbAction), true);

            reportConfiguraion.Description = string.Empty;
            using (var ms = new MemoryStream())
            {
                string file   = Ginger.Reports.GingerExecutionReport.ExtensionMethods.getGingerEXEFileName().Replace("Ginger.exe", @"Images\@amdocs_logo.jpg");
                Bitmap bitmap = new Bitmap(file);
                reportConfiguraion.LogoBase64Image = BitmapToBase64(bitmap);
            }
        }
Esempio n. 3
0
        public static HTMLReportConfiguration SetHTMLReportConfigurationWithDefaultValues(string name = null, bool RunStandalon = false)
        {
            int ConfigID = 1;
            HTMLReportConfiguration newHTMLReportConfiguration = new HTMLReportConfiguration();

            if (!RunStandalon)
            {
                if (WorkSpace.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq == 0)
                {
                    WorkSpace.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq = 1;
                }

                newHTMLReportConfiguration = new HTMLReportConfiguration();
                ConfigID = WorkSpace.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq;
                newHTMLReportConfiguration.ID = ConfigID;
            }

            if ((name != null) && (name != string.Empty))
            {
                newHTMLReportConfiguration.Name = name;
            }
            else
            {
                newHTMLReportConfiguration.Name = "Template #" + ConfigID;
            }


            newHTMLReportConfiguration.ReportLowerLevelToShow = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            if (!RunStandalon)
            {
                if (Ginger.Reports.GingerExecutionReport.ExtensionMethods.GetSolutionHTMLReportConfigurations().Count == 0)
                {
                    newHTMLReportConfiguration.IsDefault = true;
                }
                else
                {
                    newHTMLReportConfiguration.IsDefault = false;
                }
            }

            newHTMLReportConfiguration.ShowAllIterationsElements      = false;
            newHTMLReportConfiguration.UseLocalStoredStyling          = false;
            newHTMLReportConfiguration.RunSetFieldsToSelect           = GetReportLevelMembers(typeof(RunSetReport));
            newHTMLReportConfiguration.EmailSummaryViewFieldsToSelect = GetReportLevelMembers(typeof(RunSetReport));
            newHTMLReportConfiguration.GingerRunnerFieldsToSelect     = GetReportLevelMembers(typeof(GingerReport));
            newHTMLReportConfiguration.BusinessFlowFieldsToSelect     = GetReportLevelMembers(typeof(BusinessFlowReport));
            newHTMLReportConfiguration.ActivityGroupFieldsToSelect    = GetReportLevelMembers(typeof(ActivityGroupReport));
            newHTMLReportConfiguration.ActivityFieldsToSelect         = GetReportLevelMembers(typeof(ActivityReport));
            newHTMLReportConfiguration.ActionFieldsToSelect           = GetReportLevelMembers(typeof(ActionReport));
            newHTMLReportConfiguration.Description = string.Empty;
            using (var ms = new MemoryStream())
            {
                string file   = Ginger.Reports.GingerExecutionReport.ExtensionMethods.getGingerEXEFileName().Replace("Ginger.exe", @"Images\@amdocs_logo.jpg");
                Bitmap bitmap = new Bitmap(file);
                newHTMLReportConfiguration.LogoBase64Image = BitmapToBase64(bitmap);
            }
            return(newHTMLReportConfiguration);
        }
 public HTMLReportTemplatePage()
 {
     _HTMLReportConfiguration = new HTMLReportConfiguration("");
     InitializeComponent();
     SetControlsNewTemplate();
     SetDefaultLogoImage();
     SetHTMLReportsConfigFieldsGridsView();
     SetHTMLReportsConfigFieldsGridsData(_HTMLReportConfiguration);
 }
 private void SetHTMLReportsConfigFieldsGridsData(HTMLReportConfiguration HTMLReportConfiguration)
 {
     grdSummaryViewFields.DataSourceList      = HTMLReportConfiguration.RunSetFieldsToSelect;
     grdEmailSummaryViewFields.DataSourceList = HTMLReportConfiguration.EmailSummaryViewFieldsToSelect;
     grdGingersFields.DataSourceList          = HTMLReportConfiguration.GingerRunnerFieldsToSelect;
     grdBusinessFlowFields.DataSourceList     = HTMLReportConfiguration.BusinessFlowFieldsToSelect;
     grdActivityGroupsFields.DataSourceList   = HTMLReportConfiguration.ActivityGroupFieldsToSelect;
     grdActivitiesFields.DataSourceList       = HTMLReportConfiguration.ActivityFieldsToSelect;
     grdActionsFields.DataSourceList          = HTMLReportConfiguration.ActionFieldsToSelect;
 }
        public HTMLReportTemplatePage()
        {
            InitializeComponent();

            _HTMLReportConfiguration = SetHTMLReportConfigurationWithDefaultValues();
            SetControlsNewTemplate();
            SetDefaultLogoImage();
            SetHTMLReportsConfigFieldsGridsView();
            SetHTMLReportsConfigFieldsGridsData(_HTMLReportConfiguration);
        }
        public HTMLReportTemplatePage(HTMLReportConfiguration HTMLReportConfiguration)
        {
            InitializeComponent();

            _existingTemplatePage    = true;
            _HTMLReportConfiguration = EnchancingLoadedFieldsWithDataAndValidating(HTMLReportConfiguration);
            _HTMLReportConfiguration.PropertyChanged += _HTMLReportConfiguration_PropertyChanged;
            SetControls();
            SetLoadedLogoImage();
            SetHTMLReportsConfigFieldsGridsView();
            SetHTMLReportsConfigFieldsGridsData(_HTMLReportConfiguration);
        }
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            _HTMLReportConfiguration.Name        = NewTemplateNameTextBox.Text.ToString();
            _HTMLReportConfiguration.Description = TemplateDescriptionTextBox.Text.ToString();
            _newHTMLReportConfiguration          = _HTMLReportConfiguration;
            _pageGenericWin.Hide();
            WorkSpace.Instance.Solution.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.ReportConfiguration);

            if (_existingTemplatePage)
            {
                Reporter.ToStatus(eStatusMsgKey.SaveItem, null, _HTMLReportConfiguration.GetNameForFileName(), "item");
                WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(_HTMLReportConfiguration);
                Reporter.HideStatusMessage();
            }
        }
Esempio n. 9
0
        private void SelectDefualtTemplate()
        {
            if (mDefualtConfig != null)
            {
                mDefualtConfig.PropertyChanged -= MDefualtConfig_PropertyChanged;
            }

            mDefualtConfig = App.LocalRepository.GetSolutionHTMLReportConfigurations().Where(x => (x.IsDefault == true)).FirstOrDefault();
            if (mDefualtConfig != null)
            {
                DefaultTemplatePickerCbx.SelectionChanged -= DefaultTemplatePickerCbx_SelectionChanged;
                DefaultTemplatePickerCbx.SelectedItem      = mDefualtConfig;
                DefaultTemplatePickerCbx.SelectionChanged += DefaultTemplatePickerCbx_SelectionChanged;
                mDefualtConfig.PropertyChanged            += MDefualtConfig_PropertyChanged;
            }
        }
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            _HTMLReportConfiguration.Name        = NewTemplateNameTextBox.Text.ToString();
            _HTMLReportConfiguration.Description = TemplateDescriptionTextBox.Text.ToString();
            _newHTMLReportConfiguration          = _HTMLReportConfiguration;
            _pageGenericWin.Hide();

            App.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq = App.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq + 1;
            App.UserProfile.Solution.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.ReportConfiguration);

            if (_existingTemplatePage)
            {
                Reporter.ToGingerHelper(eGingerHelperMsgKey.SaveItem, null, _HTMLReportConfiguration.GetNameForFileName(), "item");
                WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(_HTMLReportConfiguration);
                Reporter.CloseGingerHelper();
            }
        }
Esempio n. 11
0
        private void SelectDefualtTemplate()
        {
            if (mDefualtConfig != null)
            {
                mDefualtConfig.PropertyChanged -= MDefualtConfig_PropertyChanged;
            }

            ObservableList <HTMLReportConfiguration> HTMLReportConfigurations = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <HTMLReportConfiguration>();

            mDefualtConfig = HTMLReportConfigurations.Where(x => (x.IsDefault == true)).FirstOrDefault();
            if (mDefualtConfig != null)
            {
                DefaultTemplatePickerCbx.SelectionChanged -= DefaultTemplatePickerCbx_SelectionChanged;
                DefaultTemplatePickerCbx.SelectedItem      = mDefualtConfig;
                DefaultTemplatePickerCbx.SelectionChanged += DefaultTemplatePickerCbx_SelectionChanged;
                mDefualtConfig.PropertyChanged            += MDefualtConfig_PropertyChanged;
            }
        }
        public static HTMLReportConfiguration SetHTMLReportConfigurationWithDefaultValues(string name = null)
        {
            if (App.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq == 0)
            {
                App.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq = 1;
            }
            HTMLReportConfiguration newHTMLReportConfiguration = new HTMLReportConfiguration();

            newHTMLReportConfiguration.ID = App.UserProfile.Solution.HTMLReportsConfigurationSetList.Where(x => (x.IsSelected == true)).FirstOrDefault().HTMLReportTemplatesSeq;
            if ((name != null) && (name != string.Empty))
            {
                newHTMLReportConfiguration.Name = name;
            }
            else
            {
                newHTMLReportConfiguration.Name = "Template #" + newHTMLReportConfiguration.ID;
            }
            newHTMLReportConfiguration.ReportLowerLevelToShow = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            if (Ginger.Reports.GingerExecutionReport.ExtensionMethods.GetSolutionHTMLReportConfigurations().Count == 0)
            {
                newHTMLReportConfiguration.IsDefault = true;
            }
            else
            {
                newHTMLReportConfiguration.IsDefault = false;
            }
            newHTMLReportConfiguration.ShowAllIterationsElements      = false;
            newHTMLReportConfiguration.UseLocalStoredStyling          = false;
            newHTMLReportConfiguration.RunSetFieldsToSelect           = GetReportLevelMembers(typeof(RunSetReport));
            newHTMLReportConfiguration.EmailSummaryViewFieldsToSelect = GetReportLevelMembers(typeof(RunSetReport));
            newHTMLReportConfiguration.GingerRunnerFieldsToSelect     = GetReportLevelMembers(typeof(GingerReport));
            newHTMLReportConfiguration.BusinessFlowFieldsToSelect     = GetReportLevelMembers(typeof(BusinessFlowReport));
            newHTMLReportConfiguration.ActivityGroupFieldsToSelect    = GetReportLevelMembers(typeof(ActivityGroupReport));
            newHTMLReportConfiguration.ActivityFieldsToSelect         = GetReportLevelMembers(typeof(ActivityReport));
            newHTMLReportConfiguration.ActionFieldsToSelect           = GetReportLevelMembers(typeof(ActionReport));
            newHTMLReportConfiguration.Description = string.Empty;
            using (var ms = new MemoryStream())
            {
                newHTMLReportConfiguration.LogoBase64Image = Ginger.Reports.GingerExecutionReport.ExtensionMethods.BitmapToBase64(Ginger.Reports.GingerExecutionReport.ExtensionMethods.BitmapImage2Bitmap(new BitmapImage(new Uri("pack://*****:*****@amdocs_logo.jpg"))));
            }
            return(newHTMLReportConfiguration);
        }
        private static ObservableList <HTMLReportConfigFieldToSelect> EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames fieldsToSelectListName, Type reportType, HTMLReportConfiguration HTMLReportConfiguration)
        {
            ObservableList <HTMLReportConfigFieldToSelect> savedFieldSelections     = (ObservableList <HTMLReportConfigFieldToSelect>)HTMLReportConfiguration.GetType().GetField(fieldsToSelectListName.ToString()).GetValue(HTMLReportConfiguration);
            ObservableList <HTMLReportConfigFieldToSelect> referenceFieldSelections = GetReportLevelMembers(reportType);

            // swap should be done between two below lists. Previose saved selection should be performed on the referenceFieldSelections
            foreach (var reference_item in referenceFieldSelections)
            {
                foreach (var saved_item in savedFieldSelections)
                {
                    if (reference_item.FieldKey == saved_item.FieldKey)
                    {
                        if (!reference_item.IsNotMandatory)     // if field is mandatory
                        {                                       // select it anyway
                            saved_item.IsSelected = true;
                        }

                        saved_item.FieldName      = reference_item.FieldName;
                        saved_item.FieldType      = reference_item.FieldType;
                        saved_item.IsSelected     = reference_item.IsSelected;
                        saved_item.IsNotMandatory = reference_item.IsNotMandatory;
                    }
                }
            }
            return(savedFieldSelections);
        }
 private static ObservableList <HTMLReportConfigFieldToSelect> EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames fieldsToSelectListName, Type reportType, HTMLReportConfiguration HTMLReportConfiguration)
 {
     return(HTMLReportConfiguration.EnchancingLoadedFieldsWithDataAndValidatingPerLevel(fieldsToSelectListName, reportType, HTMLReportConfiguration));
 }
 public static HTMLReportConfiguration EnchancingLoadedFieldsWithDataAndValidating(HTMLReportConfiguration HTMLReportConfiguration)
 {
     return(HTMLReportConfiguration.EnchancingLoadedFieldsWithDataAndValidating(HTMLReportConfiguration));
 }
 private static ObservableList <HTMLReportConfigFieldToSelect> GetReportLevelMembers(Type reportLevelType)
 {
     return(HTMLReportConfiguration.GetReportLevelMembers(reportLevelType));
 }
        public static HTMLReportConfiguration EnchancingLoadedFieldsWithDataAndValidating(HTMLReportConfiguration HTMLReportConfiguration)
        {
            HTMLReportConfiguration.RunSetFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.RunSetFieldsToSelect, typeof(RunSetReport), HTMLReportConfiguration);
            HTMLReportConfiguration.EmailSummaryViewFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.EmailSummaryViewFieldsToSelect, typeof(RunSetReport), HTMLReportConfiguration);
            HTMLReportConfiguration.GingerRunnerFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.GingerRunnerFieldsToSelect, typeof(GingerReport), HTMLReportConfiguration);
            HTMLReportConfiguration.BusinessFlowFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.BusinessFlowFieldsToSelect, typeof(BusinessFlowReport), HTMLReportConfiguration);
            HTMLReportConfiguration.ActivityGroupFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.ActivityGroupFieldsToSelect, typeof(ActivityGroupReport), HTMLReportConfiguration);
            HTMLReportConfiguration.ActivityFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.ActivityFieldsToSelect, typeof(ActivityReport), HTMLReportConfiguration);
            HTMLReportConfiguration.ActionFieldsToSelect =
                EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames.ActionFieldsToSelect, typeof(ActionReport), HTMLReportConfiguration);

            if (HTMLReportConfiguration.ReportLowerLevelToShow == null)
            {
                HTMLReportConfiguration.ReportLowerLevelToShow = HTMLReportConfiguration.ReportsLevel.ActionLevel.ToString();
            }

            return(HTMLReportConfiguration);
        }
Esempio n. 18
0
        public static ObservableList <HTMLReportConfigFieldToSelect> EnchancingLoadedFieldsWithDataAndValidatingPerLevel(HTMLReportConfiguration.FieldsToSelectListsNames fieldsToSelectListName, Type reportType, HTMLReportConfiguration HTMLReportConfiguration)
        {
            ObservableList <HTMLReportConfigFieldToSelect> savedFieldSelections     = (ObservableList <HTMLReportConfigFieldToSelect>)HTMLReportConfiguration.GetType().GetField(fieldsToSelectListName.ToString()).GetValue(HTMLReportConfiguration);
            ObservableList <HTMLReportConfigFieldToSelect> referenceFieldSelections = GetReportLevelMembers(reportType);

            // swap should be done between two below lists. Previose saved selection should be performed on the referenceFieldSelections
            foreach (var saved_item in savedFieldSelections)
            {
                var savedref_item = referenceFieldSelections.Where(x => x.FieldKey == saved_item.FieldKey).FirstOrDefault();
                if (savedref_item != null)
                {
                    if (!savedref_item.IsNotMandatory)     // if field is mandatory
                    {                                      // select it anyway
                        saved_item.IsSelected = true;
                    }
                    saved_item.FieldName      = savedref_item.FieldName;
                    saved_item.FieldType      = savedref_item.FieldType;
                    saved_item.IsNotMandatory = savedref_item.IsNotMandatory;
                }
            }
            //adding missing fields
            foreach (var reference_item in referenceFieldSelections)
            {
                var savedref_item = savedFieldSelections.Where(x => x.FieldKey == reference_item.FieldKey).FirstOrDefault();
                if (savedref_item == null)
                {
                    savedFieldSelections.Add(reference_item);
                }
            }
            return(savedFieldSelections);
        }
Esempio n. 19
0
 public HTMLReportConfigurationOperations(HTMLReportConfiguration HTMLReportConfiguration)
 {
     this.HTMLReportConfiguration = HTMLReportConfiguration;
     this.HTMLReportConfiguration.HTMLReportConfigurationOperations = this;
 }