private void LoadColumns()
 {
     Report.Columns.Clear();
     Report.TableSummaryRows.Clear();
     Report.StackedHeaderRows.Clear();
     if (ReportFlag == 0)
     {
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Id", DisplayBinding = new Binding("REPRINTNO"), Width = 80
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "User", DisplayBinding = new Binding("PRINTED_BY"), Width = 90
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Date", DisplayBinding = new Binding("BILL_DATE")
             {
                 StringFormat = "MM/dd/yyyy"
             }, Width = 90
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Time", DisplayBinding = new Binding("PRINTED_TIME"), Width = 90
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Settled Amount", DisplayBinding = new Binding("AMOUNT")
             {
                 StringFormat = "#0.00"
             }, Width = 120, TextAlignment = TextAlignment.Right
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Collected Amount", DisplayBinding = new Binding("TAXABLE_AMOUNT")
             {
                 StringFormat = "#0.00"
             }, Width = 120, TextAlignment = TextAlignment.Right
         });
         Report.Columns.Add(new GridTextColumn {
             HeaderText = "Excess/Short", DisplayBinding = new Binding("TAX_AMOUNT")
             {
                 StringFormat = "#0.00"
             }, Width = 100, TextAlignment = TextAlignment.Right
         });
         GridSummaryRow Tgsr = new GridSummaryRow()
         {
             ShowSummaryInRow = false, Title = "Total"
         };
         Tgsr.SummaryColumns.Add(new GridSummaryColumn()
         {
             MappingName = "AMOUNT", Name = "TCUSTOMER_NAME", SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate, Format = "{Sum:#,###,#0.00}"
         });
         Tgsr.SummaryColumns.Add(new GridSummaryColumn()
         {
             MappingName = "TAXABLE_AMOUNT", Name = "TDISCOUNT", SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate, Format = "{Sum:#,###,#0.00}"
         });
         Tgsr.SummaryColumns.Add(new GridSummaryColumn()
         {
             MappingName = "TAX_AMOUNT", Name = "TEXORT", SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate, Format = "{Sum:#,###,#0.00}"
         });
         Report.TableSummaryRows.Add(Tgsr);
     }
 }
Beispiel #2
0
        private void SetGridLinesGroupColumnSummaries()
        {
            // Creates the GridSummaryRow.
            GridSummaryRow captionSummaryRow = new GridSummaryRow
            {
                Name             = "CaptionSummary",
                ShowSummaryInRow = false,
                TitleColumnCount = 3,
                Title            = "{ColumnName} = {Key} ({ItemsCount} Registos)"
            };

            GridSummaryColumn summaryColumn1 = new GridSummaryColumn
            {
                Name        = "CreditAmount",
                Format      = "{Sum:c}",
                MappingName = "CreditAmount",
                SummaryType = SummaryType.DoubleAggregate
            };

            GridSummaryColumn summaryColumn2 = new GridSummaryColumn
            {
                Name        = "DebitAmount",
                Format      = "{Sum:c}",
                MappingName = "DebitAmount",
                SummaryType = SummaryType.DoubleAggregate
            };

            GridSummaryColumn summaryColumn3 = new GridSummaryColumn
            {
                Name        = "CreditTaxPayable",
                Format      = "{Sum:c}",
                MappingName = "CreditTaxPayable",
                SummaryType = SummaryType.DoubleAggregate
            };

            GridSummaryColumn summaryColumn4 = new GridSummaryColumn
            {
                Name        = "DebitTaxPayable",
                Format      = "{Sum:c}",
                MappingName = "DebitTaxPayable",
                SummaryType = SummaryType.DoubleAggregate
            };

            // Adds the summary column in the SummaryColumns collection.
            captionSummaryRow.SummaryColumns.Add(summaryColumn1);
            captionSummaryRow.SummaryColumns.Add(summaryColumn2);
            captionSummaryRow.SummaryColumns.Add(summaryColumn3);
            captionSummaryRow.SummaryColumns.Add(summaryColumn4);

            // Initializes the caption summary row.
            this.gridLines.CaptionSummaryRow = captionSummaryRow;
        }
        public Form1()
        {
            InitializeComponent();
            var data = new OrderInfoCollection();

            sfDataGrid.DataSource = data.OrdersListDetails;

            GridTableSummaryRow tableSummaryRow1 = new GridTableSummaryRow();

            tableSummaryRow1.Name             = "TableSummary";
            tableSummaryRow1.ShowSummaryInRow = true;
            tableSummaryRow1.Title            = " Total Product Count: {ProductName}";
            tableSummaryRow1.Position         = VerticalPosition.Bottom;

            GridSummaryColumn summaryColumn1 = new GridSummaryColumn();

            summaryColumn1.Name        = "ProductName";
            summaryColumn1.SummaryType = SummaryType.CountAggregate;
            summaryColumn1.Format      = "{Count}";
            summaryColumn1.MappingName = "ProductName";

            tableSummaryRow1.SummaryColumns.Add(summaryColumn1);

            this.sfDataGrid.TableSummaryRows.Add(tableSummaryRow1);


            GridSummaryRow groupSummaryRow1 = new GridSummaryRow();

            groupSummaryRow1.Name             = "GroupSummary";
            groupSummaryRow1.ShowSummaryInRow = true;
            groupSummaryRow1.Title            = " Total Product Count: {ProductName}";


            // Adds the GridSummaryColumn in SummaryColumns collection.
            groupSummaryRow1.SummaryColumns.Add(summaryColumn1);

            // Adds the summary row in the GroupSummaryRows collection.
            this.sfDataGrid.GroupSummaryRows.Add(groupSummaryRow1);


            this.sfDataGrid.SelectionController = new CustomRowSelectionController(this.sfDataGrid);

            this.sfDataGrid.AutoExpandGroups = true;
            this.sfDataGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
            {
                ColumnName = "OrderDate"
            });
            this.sfDataGrid.ClearSelection();
        }
Beispiel #4
0
 private static void OnTableSumClicked(object obj)
 {
     if (obj is GridRecordContextMenuInfo)
     {
         var grid   = (obj as GridRecordContextMenuInfo).DataGrid;
         var record = (obj as GridRecordContextMenuInfo).Record as SummaryRecordEntry;
         if (record != null)
         {
             var summaryrow = new GridSummaryRow()
             {
                 ShowSummaryInRow = true, Name = "totalgroupsummaryrow", Title = "{totalSummary}"
             };
             summaryrow.SummaryColumns.Add(new GridSummaryColumn()
             {
                 Name = "totalSummary", MappingName = "EmployeeAge", SummaryType = SummaryType.DoubleAggregate, Format = "Sum Employee Salary : {Sum}"
             });
             grid.TableSummaryRows.Clear();
             grid.TableSummaryRows.Add(summaryrow);
         }
     }
 }
Beispiel #5
0
        private void SetupGroupSummary()
        {
            var groupSummaryRow1 = new GridSummaryRow {
                Name = "GroupSummary", ShowSummaryInRow = false
            };

            // Creates the GridSummaryColumn.
            var summaryColumn1 = new GridSummaryColumn
            {
                Name        = "UnitPrice",
                SummaryType = SummaryType.DoubleAggregate,
                Format      = "{Sum:c}",
                MappingName = "Tool.Price"
            };

            // Adds the GridSummaryColumn in SummaryColumns collection.
            groupSummaryRow1.SummaryColumns.Add(summaryColumn1);

            // Adds the summary row in the GroupSummaryRows collection.
            sdgOrders.GroupSummaryRows.Clear();
            sdgOrders.GroupSummaryRows.Add(groupSummaryRow1);
        }
Beispiel #6
0
        private void Gc1_SourceListListChangedCompleted(object sender, TableListChangedEventArgs e)
        {
            var            r   = this.gc1.TableModel.RowCount;
            var            p   = this.gc1.TableModel.Rows.Model.RowCount;
            GridSummaryRow rec = this.gc1.Table.DisplayElements[r] as GridSummaryRow;
            GridRecordRow  row = this.gc1.Table.DisplayElements[r] as GridRecordRow;

            if (row is GridRecordRow)
            {
                MessageBox.Show("row");
            }
            if (rec is GridSummaryRow)
            {
                foreach (var scd in rec.SummaryRowDescriptor.SummaryColumns)
                {
                    if (scd.Name == "Machine Hours Remaining")
                    {
                        txtMachine.Text = GridEngine.GetSummaryText(rec.ParentGroup, scd);
                    }
                    else if (scd.Name == "Weld Hours Remaining")
                    {
                        txtWeld.Text = GridEngine.GetSummaryText(rec.ParentGroup, scd);
                    }
                    else if (scd.Name == "Build Hours Remaining")
                    {
                        txtBuild.Text = GridEngine.GetSummaryText(rec.ParentGroup, scd);
                    }
                    else if (scd.Name == "Tracker Hours Remaining")
                    {
                        txtTrackers.Text = GridEngine.GetSummaryText(rec.ParentGroup, scd);
                    }
                    else if (scd.Name == "Design Hours Remaining")
                    {
                        txtDesign.Text = GridEngine.GetSummaryText(rec.ParentGroup, scd);
                    }
                }
            }
        }
Beispiel #7
0
        /// <summary>
        /// Sets the sample customization settings.
        /// </summary>
        private void SampleCustomization()
        {
            #region SfDataGrid settings
            sfDataGrid1.ThemeName                = "Office2016Colorful";
            sfDataGrid1.ShowRowHeader            = true;
            sfDataGrid1.AllowFiltering           = true;
            this.sfDataGrid1.AllowGrouping       = true;
            this.sfDataGrid1.ShowGroupDropArea   = true;
            this.sfDataGrid1.AutoGenerateColumns = false;
            this.sfDataGrid1.AutoSizeColumnsMode = AutoSizeColumnsMode.Fill;

            OrderInfoRepository orderInfo = new OrderInfoRepository();
            this.sfDataGrid1.DataSource = orderInfo.GetOrdersDetails(30);
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ShipCity", HeaderText = "Ship City"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ShipCity", HeaderText = "Ship Country"
            });
            this.sfDataGrid1.Columns.Add(new GridDateTimeColumn()
            {
                MappingName = "ShippingDate", HeaderText = "Shipping Date"
            });
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Freight", HeaderText = "Freight", FormatMode = FormatMode.Currency
            });
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "IsClosed", HeaderText = "Is Closed"
            });
            sfDataGrid1.AllowResizingColumns = true;
            #endregion

            #region themComboBox settings
            List <ThemeTypes> theme = new List <ThemeTypes>();
            theme.Add(new ThemeTypes()
            {
                ThemeName = "Office2016Black", Value = 1
            });
            theme.Add(new ThemeTypes()
            {
                ThemeName = "Office2016White", Value = 2
            });
            theme.Add(new ThemeTypes()
            {
                ThemeName = "Office2016DarkGray", Value = 3
            });
            theme.Add(new ThemeTypes()
            {
                ThemeName = "Office2016Colorful", Value = 4
            });
            comboBox1.DataSource            = theme;
            comboBox1.DisplayMember         = "ThemeName";
            comboBox1.ValueMember           = "ThemeName";
            comboBox1.SelectedValueChanged += comboBox1_SelectedValueChanged;
            comboBox1.SelectedValue         = "Office2016Colorful";
            #endregion

            this.checkBox1.Style      = Syncfusion.Windows.Forms.Tools.CheckBoxAdvStyle.Office2016Colorful;
            checkBox1.CheckedChanged += checkBox1_CheckedChanged;

            #region TableSummaryRow

            GridTableSummaryRow tableSummaryRow1 = new GridTableSummaryRow();
            tableSummaryRow1.Name             = "TableSummary";
            tableSummaryRow1.ShowSummaryInRow = true;
            tableSummaryRow1.Title            = " Total Count: {OrderID}";
            tableSummaryRow1.Position         = VerticalPosition.Bottom;

            GridSummaryColumn summaryColumn1 = new GridSummaryColumn();
            summaryColumn1.Name        = "OrderID";
            summaryColumn1.SummaryType = SummaryType.DoubleAggregate;
            summaryColumn1.Format      = "{Count}";
            summaryColumn1.MappingName = "OrderID";
            tableSummaryRow1.SummaryColumns.Add(summaryColumn1);
            this.sfDataGrid1.TableSummaryRows.Add(tableSummaryRow1);

            #endregion

            #region GroupSummaryRow

            // Creates the GridSummaryRow.
            GridSummaryRow groupSummaryRow1 = new GridSummaryRow();
            groupSummaryRow1.Name             = "GroupSummary";
            groupSummaryRow1.ShowSummaryInRow = false;
            groupSummaryRow1.Title            = "Total  $: { OrderID }";

            // Creates the GridSummaryColumn.
            GridSummaryColumn summaryColumn3 = new GridSummaryColumn();
            summaryColumn3.Name        = "OrderID";
            summaryColumn3.SummaryType = SummaryType.DoubleAggregate;
            summaryColumn3.Format      = "Total : {Sum:c}";
            summaryColumn3.MappingName = "OrderID";

            // Adds the GridSummaryColumn in SummaryColumns collection.
            groupSummaryRow1.SummaryColumns.Add(summaryColumn3);

            // Adds the summary row in the GroupSummaryRows collection.
            this.sfDataGrid1.GroupSummaryRows.Add(groupSummaryRow1);


            #endregion

            #region Relation Creation
            GridViewDefinition viewDefinition = new GridViewDefinition();
            viewDefinition.RelationalColumn = "OrderDetails";
            firstLevelSourceDataGrid        = new SfDataGrid();
            firstLevelSourceDataGrid.Columns.Add(new GridTextColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID"
            });
            firstLevelSourceDataGrid.Columns.Add(new GridDateTimeColumn()
            {
                MappingName = "OrderDate", HeaderText = "Order Date"
            });
            firstLevelSourceDataGrid.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            firstLevelSourceDataGrid.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerCity", HeaderText = "Customer City"
            });
            firstLevelSourceDataGrid.Columns.Add(new GridNumericColumn()
            {
                MappingName = "ProductID", HeaderText = "Product ID", FormatMode = FormatMode.Numeric
            });
            firstLevelSourceDataGrid.Columns.Add(new GridNumericColumn()
            {
                MappingName = "UnitPrice", HeaderText = "Unit Price", FormatMode = FormatMode.Currency
            });
            firstLevelSourceDataGrid.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Quantity", HeaderText = "Quantity", FormatMode = FormatMode.Numeric
            });
            firstLevelSourceDataGrid.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent
            });
            StackedHeaderRow stackedHeaderRow = new StackedHeaderRow();
            stackedHeaderRow.StackedColumns.Add(new StackedColumn()
            {
                ChildColumns = "OrderID,OrderDate", HeaderText = "Order Details"
            });
            stackedHeaderRow.StackedColumns.Add(new StackedColumn()
            {
                ChildColumns = "CustomerID,CustomerCity", HeaderText = "Customer Details"
            });
            stackedHeaderRow.StackedColumns.Add(new StackedColumn()
            {
                ChildColumns = "ProductID,UnitPrice,Quantity,Discount", HeaderText = "Product Details"
            });
            firstLevelSourceDataGrid.AllowResizingColumns = true;
            firstLevelSourceDataGrid.AutoSizeColumnsMode  = AutoSizeColumnsMode.Fill;
            viewDefinition.DataGrid = firstLevelSourceDataGrid;
            this.sfDataGrid1.DetailsViewDefinitions.Add(viewDefinition);
            #endregion

            this.sfDataGrid1.HideEmptyGridViewDefinition = true;
        }
        private void LoadColumns()
        {
            Report.Columns.Clear();
            Report.TableSummaryRows.Clear();
            Report.StackedHeaderRows.Clear();
            if (ReportFlag == 0)
            {
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Bill No", DisplayBinding = new Binding("BILL_NO"), Width = 70
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Date", DisplayBinding = new Binding("BILL_DATE")
                    {
                        StringFormat = "MM/dd/yyyy"
                    }, Width = 70
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Time", DisplayBinding = new Binding("PRINTED_TIME"), Width = 70
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Voucher No", DisplayBinding = new Binding("REF_NO"), Width = 80
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Voucher Name", DisplayBinding = new Binding("REMARKS"), Width = 280
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Customer", DisplayBinding = new Binding("CUSTOMER_NAME"), Width = 250
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "User Name", DisplayBinding = new Binding("PRINTED_BY"), Width = 100
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Discount", DisplayBinding = new Binding("DISCOUNT")
                    {
                        StringFormat = "#0.00"
                    }, Width = 100, TextAlignment = TextAlignment.Right
                });
                GridSummaryRow Tgsr = new GridSummaryRow()
                {
                    ShowSummaryInRow = false
                };
                Tgsr.SummaryColumns.Add(new GridSummaryColumn()
                {
                    MappingName = "CUSTOMER_NAME", Name = "TCUSTOMER_NAME", SummaryType = Syncfusion.Data.SummaryType.CountAggregate, Format = "{Count}"
                });
                Tgsr.SummaryColumns.Add(new GridSummaryColumn()
                {
                    MappingName = "DISCOUNT", Name = "TDISCOUNT", SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate, Format = "{Sum:#,###,#0.00}"
                });
                Report.TableSummaryRows.Add(Tgsr);
            }
            else if (ReportFlag == 1)
            {
                string Header = (SummaryType == "REMARKS") ? "Voucher Name" : ((SummaryType == "CUSTOMER_NAME") ? "Customer" : "User Name");

                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Date", DisplayBinding = new Binding("BILL_DATE")
                    {
                        StringFormat = "MM/dd/yyyy"
                    }, Width = 150
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = Header, DisplayBinding = new Binding(SummaryType), Width = 600
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "No of Voucher", DisplayBinding = new Binding("REPRINTNO"), Width = 150
                });
                Report.Columns.Add(new GridTextColumn {
                    HeaderText = "Discount", DisplayBinding = new Binding("DISCOUNT")
                    {
                        StringFormat = "#0.00"
                    }, Width = 150, TextAlignment = TextAlignment.Right
                });
                GridSummaryRow Tgsr = new GridSummaryRow()
                {
                    ShowSummaryInRow = false
                };
                Tgsr.SummaryColumns.Add(new GridSummaryColumn()
                {
                    MappingName = "REPRINTNO", Name = "TREPRINTNO", SummaryType = Syncfusion.Data.SummaryType.Int32Aggregate, Format = "{Sum}"
                });
                Tgsr.SummaryColumns.Add(new GridSummaryColumn()
                {
                    MappingName = "DISCOUNT", Name = "TDISCOUNT", SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate, Format = "{Sum:#,###,#0.00}"
                });
                Report.TableSummaryRows.Add(Tgsr);
            }
        }