private void CustomExport(object sender, CustomExportEventArgs e)
 {
     foreach (var printControl in e.GetPrintableControls())
     {
         if (printControl.Value is XRChart)
         {
             var pieItemName = printControl.Key;
             IDashboardControl dashboardControl = (IDashboardControl)sender;
             PieDashboardItem  pieDashboardItem = dashboardControl.Dashboard.Items[pieItemName] as PieDashboardItem;
             if (pieDashboardItem == null)
             {
                 return;
             }
             XRChart pieChart = printControl.Value as XRChart;
             if (pieChart == null || pieChart.Diagram == null)
             {
                 return;
             }
             pieChart.Diagram.Tag             = pieItemName;
             pieChart.CustomizePieTotalLabel += (s, args) => {
                 string componentName      = (s as XRChart).Diagram.Tag.ToString();
                 MultiDimensionalData data = e.GetItemData(componentName);
                 CustomizePieTotalLabel(componentName, data, args);
             };
             foreach (Series series in pieChart.Series)
             {
                 (series.View as PieSeriesView).TotalLabel.Visible = true;
             }
         }
     }
 }
        public static bool AuthorizeAccess(IDashboardControl dashboardTab, IUser user, ISectionService sectionService)
        {
            if (user.Id.ToString(CultureInfo.InvariantCulture) == Constants.System.Root.ToInvariantString())
            {
                return(true);
            }

            var denyTypes             = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Deny).ToArray();
            var grantedTypes          = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Grant).ToArray();
            var grantedBySectionTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.GrantBySection).ToArray();

            return(CheckUserAccessByRules(user, sectionService, denyTypes, grantedTypes, grantedBySectionTypes));
        }
        public static bool AuthorizeAccess(IDashboardControl dashboardTab, IUser user, ISectionService sectionService)
        {
            if (user.Id.ToString() == Constants.System.Root.ToInvariantString())
            {
                return true;
            }

            var denyTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Deny).ToArray();
            var grantedTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Grant).ToArray();
            var grantedBySectionTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.GrantBySection).ToArray();

            return CheckUserAccessByRules(user, sectionService, denyTypes, grantedTypes, grantedBySectionTypes);
        }
Example #4
0
 /// <summary>
 /// Attaches the Extension to DashboardViewer or DashboardDesigner
 /// </summary>
 public void Attach(IDashboardControl dashboardControl)
 {
     Detach();
     this.dashboardControl = dashboardControl;
     // Handle Events
     this.dashboardControl.DashboardItemClick += DashboardItemClick;
     if (dashboardDesigner != null)
     {
         AddButtonToRibbon();
         dashboardDesigner.DashboardCustomPropertyChanged += TargetDesigner_DashboardCustomPropertyChanged;
         dashboardDesigner.DashboardItemSelected          += DashboardItemSelected;
     }
 }
        public void Attach(IDashboardControl dashboardControl)
        {
            Detach();
            this.dashboardControl = dashboardControl;
            this.dashboardControl.CalculateHiddenTotals        = true;
            this.dashboardControl.DashboardItemControlUpdated += DashboardItemControlUpdated;
            this.dashboardControl.CustomExport += CustomExport;

            if (dashboardDesigner != null)
            {
                AddButtonToRibbon();
                dashboardDesigner.DashboardItemSelected    += DashboardDesigner_DashboardItemSelected;
                dashboardDesigner.Dashboard.OptionsChanged += Dashboard_OptionsChanged;
            }
        }
Example #6
0
 /// <summary>
 /// Detaches the Extension from the control
 /// </summary>
 public void Detach()
 {
     if (dashboardControl == null)
     {
         return;
     }
     if (dashboardDesigner != null)
     {
         RemoveButtonFromRibbon();
         dashboardDesigner.DashboardCustomPropertyChanged -= TargetDesigner_DashboardCustomPropertyChanged;
         dashboardDesigner.DashboardItemSelected          -= DashboardItemSelected;
     }
     dashboardControl.DashboardItemClick -= DashboardItemClick;
     dashboardControl = null;
 }
 public void Detach()
 {
     if (dashboardControl == null)
     {
         return;
     }
     if (dashboardDesigner != null)
     {
         RemoveButtonFromRibbon();
     }
     this.dashboardControl.DashboardItemControlUpdated -= DashboardItemControlUpdated;
     this.dashboardControl.CustomExport -= CustomExport;
     if (dashboardDesigner != null)
     {
         RemoveButtonFromRibbon();
         dashboardDesigner.DashboardItemSelected -= DashboardDesigner_DashboardItemSelected;
     }
     dashboardControl = null;
 }
 private void CustomExport(object sender, CustomExportEventArgs e)
 {
     foreach (var printControl in e.GetPrintableControls())
     {
         if (printControl.Value is XRChart)
         {
             var chartItemName = printControl.Key;
             IDashboardControl  dashboardControl = (IDashboardControl)sender;
             ChartDashboardItem chartItem        = dashboardControl.Dashboard.Items[chartItemName] as ChartDashboardItem;
             if (chartItem == null || chartItem.Panes.Count > 1)
             {
                 return;
             }
             XRChart xrChart = printControl.Value as XRChart;
             if (xrChart == null)
             {
                 return;
             }
             MultiPaneSettings settings = MultiPaneSettings.FromJson(chartItem.CustomProperties[customPropertyName]);
             CustomizeDiagram(xrChart.Diagram as XYDiagram, xrChart.Series, settings);
         }
     }
 }
 public static bool AuthorizeAccess(IDashboardControl dashboardControl, IUser user, ISectionService sectionService)
 {
     return(CheckUserAccessByRules(user, sectionService, dashboardControl.AccessRights.Rules));
 }