public override void Update() { _BaslangicTarihi = OwnerPage.BaslangicTarihi; _BitisTarihi = OwnerPage.BitisTarihi; ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string BayiID = curProfile.GetPropertyValue("BayiID").ToString(); if (Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelYonetici") { if (BayiID == null || BayiID == "" || BayiID == "130" || BayiID == "140") //if ile yönetici yetkisi roles dan kontrol edip -1 göndermek lazım. { BayiID = "-1"; } } var listPivot = db.S_HedefSatisDurumuPivot(Convert.ToInt32(BayiID), _BaslangicTarihi, _BitisTarihi).ToList(); if (listPivot.Count > 0) { PivotGrid.DataSource = listPivot; PivotGrid.DataBind(); } else { PivotGrid.DataSource = null; PivotGrid.DataBind(); } }
/// <summary> /// 디테일 내용을 출력한다. /// </summary> private void fnDetail() { try { DataTable dtdetail = PivotGrid.GetPivotFocusedCellInfo(this.pivotGrid, Cls.Grid.PivotGrid.DataReturnType.FocusedCell); string fcv = BizCommon.Parm_F.FACILITY_CODE_EVENT; //string facilityCode = dtdetail.Rows[0]["FACILITY_CODE"].ToString().Trim(); string use_date = dtdetail.Rows[0]["USE_DATE"].ToString().Trim().Replace("-", ""); DataTable dtparm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter); dtparm.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode }); //dtparm.Rows.Add(new object[] { "V_MENU_CODE", menucode }); dtparm.Rows.Add(new object[] { "V_FACILILTY_CODE", fcv }); dtparm.Rows.Add(new object[] { "V_USE_DATE", use_date }); dtDet.Clear(); DataSet ds = DataLayer.ExecuteSpDataset("PKG_FARAS07.PR_02", dtparm, DataLayer.MessageEncoding.Default); dtDet.Load(ds.Tables[0].CreateDataReader()); this.gridFacility.Focus(); } catch (Exception ex) { throw ex; } }
void InitPivotLayoutSampleOlapDB(AsyncOperationResult result) { PivotGrid.RetrieveFields(FieldArea.FilterArea, false); if (PivotGrid.Fields.Count == 0) { InitializationCompletedCallback.Invoke(null); return; } PivotGrid.BeginUpdate(); PivotGridField fieldProduct = PivotGrid.Fields[CategoryFieldName], fieldYear = PivotGrid.Fields[YearFieldName], fieldTotalCost = PivotGrid.Fields[TotalCostFieldName], fieldFreightCost = PivotGrid.Fields[FreightFieldName], fieldOrderQuantity = PivotGrid.Fields[QuantityOrderFieldName]; PivotGrid.Groups[1].Caption = "Calendar"; PivotGrid.Groups[2].Caption = "Products"; fieldProduct.Area = FieldArea.RowArea; fieldYear.Area = FieldArea.ColumnArea; fieldYear.SortOrder = FieldSortOrder.Descending; fieldTotalCost.Width = DefaultFieldWidth; fieldTotalCost.CellFormat = "c2"; fieldFreightCost.Width = DefaultFieldWidth; fieldFreightCost.CellFormat = "c2"; fieldOrderQuantity.Width = DefaultFieldWidth; fieldProduct.Visible = true; fieldYear.Visible = true; fieldTotalCost.Visible = true; fieldFreightCost.Visible = true; fieldOrderQuantity.Visible = true; PivotGrid.EndUpdateAsync(ExpandAll); }
/// <summary> /// Summary type selected /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AggregationTypeMenuItem_Click(object sender, EventArgs e) { PivotGridFieldMx f = PivotGridField; DXMenuItem mi = sender as DXMenuItem; string typeName = mi.Tag.ToString(); // tag is enum member name AggregationTypeDetail atd = AggregationTypeDetail.GetByTypeName(typeName, true); if (atd.IsGroupingType && atd.GroupingType == GroupingTypeEnum.NumericInterval) { DialogResult dr = NumericIntervalDialog.ShowDialog(f.Aggregation, UIMisc.MousePosition); //if (dr == DialogResult.Cancel) return; } f.Aggregation.SetFromTypeName(typeName); f.SyncDxAreaToMxRole(); // sync Dx area PivotGrid.RefreshData(); if (UpdateViewWhenGridControlChanges) { View.UpdateViewFieldsFromGridFields(); } return; }
void SetDataSourceGeneratedDatabase(DataSet dataSet) { if (dataSet == null) { PivotGrid.IsEnabled = false; InitializationCompletedCallback.Invoke(null); return; } PivotGrid.SetDataSourceAsync(dataSet.Tables[0], InitPivotLayoutGeneratedDB); }
protected override void Initialize() { try { PivotGrid.SetOlapConnectionStringAsync(OLAPSampleConnectionString, InitPivotLayoutSampleOlapDB); } catch (OLAPConnectionException) { PivotGrid.OlapConnectionString = null; PivotGrid.IsEnabled = false; InitializationCompletedCallback.Invoke(null); } }
/// <summary> /// 设置Store /// </summary> /// <returns></returns> private string GetStore() { PivotGrid control = this.ControlHost.Content as PivotGrid; StringBuilder result = new StringBuilder(); bool bindingDataSource = false; Dictionary <string, string> dictProperty = control.GetPropertyBindValue(); if (!IsPreview && control.Bindings.Count > 0) { foreach (var item in control.Bindings) { string bindPath = item.Path == null ? "" : item.Path; string bindProperty = item.Property == null ? "" : item.Property; if (bindProperty.ToLower() == "datasource") { string property = string.Empty; if (dictProperty.ContainsKey(bindProperty)) { if (dictProperty.TryGetValue(bindProperty, out property)) { bindProperty = property; } } if (!string.IsNullOrEmpty(bindPath) && !string.IsNullOrEmpty(bindProperty)) { result.AppendFormat("store:at('rel:{0}', '{1}').direction(1),", "", bindPath); if (bindProperty.ToLower() == "datasource") { bindingDataSource = true; } } } } } if (!IsPreview && control.ExistProperty("DataSource") && !bindingDataSource) { string bindPath = control.DataSource; string bindProperty = "DataSource"; if (!string.IsNullOrEmpty(bindPath)) { string property = string.Empty; if (dictProperty.ContainsKey(bindProperty)) { if (dictProperty.TryGetValue(bindProperty, out property)) { bindProperty = property; } } result.AppendFormat("store:at('rel:{0}', '{1}').direction(1),", "", bindPath); } } return(result.ToString()); }
/// <summary> /// 데이터 테이블을 정의 합니다 /// </summary> private void SetDataTable() { PivotGrid.InitializePivot(this.pivotGridControl); //잔여객실 < 1 색상 PivotGrid.PivotSetClor(this.pivotGridControl, pivotGridField_REMAIN_CNT, Color.Red, "[REMAIN_CNT] < 1 "); //주말 색상 PivotGrid.PivotSetClor(this.pivotGridControl, pivotGridField_USE_CNT, Color.LightBlue, "[SEASON_CODE] LIKE '%11'"); PivotGrid.PivotSetClor(this.pivotGridControl, pivotGridField_IN_TYPE_PLAN_CNT, Color.LightBlue, "[SEASON_CODE] LIKE '%11'"); PivotGrid.PivotSetClor(this.pivotGridControl, pivotGridField_REMAIN_CNT, Color.LightBlue, "[SEASON_CODE] LIKE '%11'"); this.pivotGridControl.DataSource = dt; }
/// <summary> /// The area that a field is located in has changed. /// If changed by the DX UI then the added members in PivotGridFieldMx must be updated /// If changed by Mobius code (InSetup = true) then nothing needed here. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Grid_FieldAreaChanged(object sender, PivotFieldEventArgs e) { if (InSetup) { return; } try { InSetup = true; PivotGridFieldContext fc = GetPivotGridFieldContext(e.Field); if (fc == null) { return; } PivotGridFieldMx f = fc.F; f.SyncMxRoleToDxArea(); ResultsField rfld = fc.ResultsField; if (rfld == null || rfld.MetaColumn == null) { return; } f.Aggregation.SetDefaultTypeIfUndefined(rfld.MetaColumn); // may need to set default type as well PivotGridControlMx.SetFieldCaption(f); PivotGrid.RefreshData(); // recalc summaries if (UpdateViewWhenGridControlChanges) { View.UpdateViewFieldsFromGridFields(); } return; } finally { InSetup = false; } }
public PivotGridUI(PivotGrid task, bool showChart) { _task = task; InitializeComponent(); var save = contextMenuStrip1.Items.Add("Save Report"); save.Click += delegate { var x = new SaveFileDialog(); MyDialog(x, f => pivotGridControl1.SaveLayoutToXml(f)); }; var load = contextMenuStrip1.Items.Add("Load Report"); load.Click += delegate { var x = new OpenFileDialog(); MyDialog(x, y => pivotGridControl1.RestoreLayoutFromXml(y)); }; this.splitContainerControl1.Panel2.Visible = showChart; if (!showChart) { this.splitContainerControl1.Panel1.Dock = DockStyle.Fill; } foreach (var item in System.Enum.GetValues(typeof(DevExpress.XtraCharts.ViewType))) { comboBox1.Items.Add(item); } comboBox1.SelectedItem = ViewType.Bar; comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; comboBox1.SelectedValueChanged += (s, e) => { if (comboBox1.SelectedItem is ViewType) { try { chartControl1.SeriesTemplate.ChangeView((ViewType)comboBox1.SelectedItem); } catch { } } }; }
public IWebDriver TestFixtureSetUp(string Bname, string testCaseName) { driver = StartBrowser(Bname); Common.CurrentDriver = driver; Results.WriteTestSuiteHeading(typeof(TestSuite10_Reskin_Schedule).Name); starttest(Bname + " - " + testCaseName, typeof(TestSuite10_Reskin_Schedule).Name); loginPage = new Login(driver, test); homePage = new Home(driver, test); searchPage = new Search(driver, test); fieldOptions = new FieldOptions(driver, test); userProfile = new UserProfile(driver, test); schedule = new Schedule(driver, test); brandDashboard = new BrandDashboard(driver, test); pivotGrid = new PivotGrid(driver, test); charts = new Charts(driver, test); myExportsPage = new MyExportsPage(driver, test); return(driver); }
public IWebDriver TestFixtureSetUp(string Bname, string testCaseName) { driver = StartBrowser(Bname); Common.CurrentDriver = driver; Results.WriteTestSuiteHeading(typeof(TestSuite14_Reskin_MultiTree).Name); starttest(Bname + " - " + testCaseName, typeof(TestSuite14_Reskin_MultiTree).Name); loginPage = new Login(driver, test); homePage = new Home(driver, test); searchPage = new Search(driver, test); fieldOptions = new FieldOptions(driver, test); userProfile = new UserProfile(driver, test); carousels = new Carousels(driver, test); brandDashboard = new BrandDashboard(driver, test); pivotGrid = new PivotGrid(driver, test); charts = new Charts(driver, test); schedule = new Schedule(driver, test); allAnalyticsBreadCrumbs = new AllAnalytics_BreadCrumbs(driver, test);; return(driver); }
/// <summary> /// 设置属性 /// </summary> protected override void SetAttributes() { PivotGrid control = this.ControlHost.Content as PivotGrid; this.HtmlWriter.AddAttribute("dojoType", "Controls/PivotGrid"); if (!IsPreview && !string.IsNullOrEmpty(this.ControlHost.Name)) { this.HtmlWriter.AddAttribute("id", this.ControlHost.Name); this.HtmlWriter.AddAttribute("name", this.ControlHost.Name); } StringBuilder sbProps = new StringBuilder(); StringBuilder returnContent = new StringBuilder(); string props = control.BuildControlProps(this.ScreenDefinition, this.IsPreview, this.PermissionData, returnContent); if (!string.IsNullOrEmpty(props)) { sbProps.AppendFormat("{0},", props); } string stores = GetStore(); if (!string.IsNullOrEmpty(stores)) { sbProps.AppendFormat("{0},", stores.Substring(0, stores.Length - 1)); } string wptOptions = BuildOptions(); if (!string.IsNullOrEmpty(wptOptions)) { sbProps.AppendFormat("{0},", wptOptions); } if (sbProps.ToString().Length > 0) { this.HtmlWriter.AddAttribute("data-dojo-props", sbProps.ToString().Substring(0, sbProps.ToString().Length - 1), false); } base.SetAttributes(); }
private void btnAccept_Click(object sender, EventArgs e) { try { PivotGridField newBonus = GetNewInvisibleBonusField(); newBonus.Visible = true; //newBonus.AreaIndex = PivotGrid.Fields["BonusAmount"].AreaIndex; PivotGrid.Fields.Add(newBonus); txtFieldName.Text = string.Empty; btnAccept.Enabled = false; txtFieldExpression.Text = string.Empty; txtFieldExpression.Enabled = false; PivotGrid.BestFit(); DialogResult = DialogResult.OK; } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
private void PivotGrid_CustomSummary(object sender, PivotCustomSummaryEventArgs e) { if (e.DataField.Name == Name) { if ((e.ColumnField == null) || (e.RowField == null)) { //this is Grand Total cell e.CustomValue = "Grand Total"; return; } int lastRowFieldIndex = PivotGrid.GetFieldsByArea(FieldArea.RowArea).Count() - 1; int lastColumnFieldIndex = PivotGrid.GetFieldsByArea(FieldArea.ColumnArea).Count() - 1; if (e.RowField.AreaIndex == lastRowFieldIndex && e.ColumnField.AreaIndex == lastColumnFieldIndex) { //this is Ordinary cell e.CustomValue = e.SummaryValue.Summary; } else { //this is Total cell e.CustomValue = "Total"; } } }
private void pivotGrid_CellDoubleClick(object sender, PivotCellEventArgs e) { try { DataTable dtg = new DataTable(); DataTable dtdetail = PivotGrid.GetPivotFocusedCellInfo(this.pivotGrid, Cls.Grid.PivotGrid.DataReturnType.FocusedCell); string tcb = BizCommon.Parm_F.TYPE_CODE_EVENT; string facility = dtdetail.Rows[0]["FACILITY_CODE"].ToString().Trim(); string use_date = dtdetail.Rows[0]["USE_DATE"].ToString().Trim(); string facilitynm = dtdetail.Rows[0]["FACILITY_NAME"].ToString().Trim(); FAHA.FAHAH05 h = new Erp.Event.FAHA.FAHAH05(use_date, facilitynm, facility, tcb, "Getdeposit"); h.Owner = this; h.ShowDialog(); fnSelect(); } catch (Exception ex) { Basic.ShowMessage(3, ex.Message); } }
void InitPivotLayoutGeneratedDB(AsyncOperationResult result) { PivotGrid.BeginUpdate(); PivotGridField fieldSalesPerson = CreatePivotGridField("SalesPersonName", "Sales Person", FieldArea.RowArea); PivotGridField fieldCustomer = CreatePivotGridField("CustomerName", "Customer", FieldArea.FilterArea); PivotGridField fieldQuantity = CreatePivotGridField("Quantity", "Quantity", FieldArea.DataArea); PivotGridField fieldUnitPrice = CreatePivotGridField("UnitPrice", "Unit Price", FieldArea.DataArea); fieldUnitPrice.SummaryType = FieldSummaryType.Average; fieldUnitPrice.ShowSummaryTypeName = true; PivotGridField fieldOrderID = CreatePivotGridField("OrderID", "Order ID", FieldArea.FilterArea); PivotGridField fieldCategory = CreatePivotGridField("CategoryName", "Category", FieldArea.RowArea); PivotGridField fieldProduct = CreatePivotGridField("ProductName", "Product", FieldArea.RowArea); PivotGridField fieldOrderDateYear = CreatePivotGridField("OrderDate", "Year", FieldArea.ColumnArea); fieldOrderDateYear.GroupInterval = FieldGroupInterval.DateYear; PivotGridField fieldOrderDateMonth = CreatePivotGridField("OrderDate", "Month", FieldArea.ColumnArea); fieldOrderDateMonth.GroupInterval = FieldGroupInterval.DateMonth; PivotGridField fieldPrice = new PivotGridField(); fieldPrice.Area = FieldArea.DataArea; fieldPrice.Caption = "Price"; fieldPrice.UnboundType = FieldUnboundColumnType.Decimal; fieldQuantity.Width = DefaultFieldWidth; fieldUnitPrice.Width = DefaultFieldWidth; fieldPrice.Width = DefaultFieldWidth; PivotGrid.Fields.AddRange(new PivotGridField[] { fieldSalesPerson, fieldCustomer, fieldQuantity, fieldUnitPrice, fieldOrderID, fieldCategory, fieldProduct, fieldOrderDateYear, fieldOrderDateMonth, fieldPrice }); PivotGrid.Groups.Add(fieldOrderDateYear, fieldOrderDateMonth); fieldPrice.UnboundExpression = "[" + fieldQuantity.ExpressionFieldName + "] * [" + fieldUnitPrice.ExpressionFieldName + "]"; PivotGrid.EndUpdateAsync(InitializationCompletedCallback); }
private void ConsolePivotControl_Load(object sender, EventArgs e) { PivotGrid.FieldsCustomization(navPageCustomization); }
void ExpandAll(AsyncOperationResult result) { PivotGrid.ExpandAllAsync(InitializationCompletedCallback); }
/// <summary> /// 데이터 테이블을 정의 합니다 /// </summary> private void SetDataTable() { PivotGrid.InitializePivot(this.pivotGridControl); this.pivotGridControl.DataSource = dt; }