Пример #1
0
 private void btPivotTable_Click(object sender, EventArgs e)
 {
     DialogResult = DialogResult.OK;
     BUS.CommonControl commo = new BUS.CommonControl();
     //_sqlBuilder.StrConnectDes = _strConnectDes;
     _dataTable = _sqlBuilder.BuildDataTable("");
     //_dataTable = _sqlBuilder.BuildDataTable("");
     Close();
 }
Пример #2
0
        private void btnList_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Status       = "L";
            BUS.LIST_QD_SCHEMAControl schCtr = new LIST_QD_SCHEMAControl();
            //DTO.LIST_QD_SCHEMAInfo schInf
            string key = schCtr.GetDefaultDB(_sqlBuilder.Database, _sqlBuilder.Table, ref _sErr);

            _strConnectDes     = _sqlBuilder.StrConnectDes = _config.GetConnection(ref key, "AP");
            _sqlBuilder.ConnID = key;
            BUS.CommonControl commo = new BUS.CommonControl();
            _sqlBuilder.StrConnectDes = _strConnectDes;
            _dataReturn = _sqlBuilder.BuildDataTable("");
            Close();
            //FrmListReport frm = new FrmListReport(_dataTable);
            ////TopMost = false;
            //frm.FormClosed += new FormClosedEventHandler(frm_FormClosed);
            //frm.ShowDialog();
        }
Пример #3
0
        private void LoadDataGrid()
        {
            BUS.CommonControl commo = new BUS.CommonControl();
            //_sqlBuilder.StrConnectDes = _strConnectDes;
            DataTable dt = _sqlBuilder.BuildDataTable("");

            dgvResult.DataSource = dt;
            dgvResult.RetrieveStructure();
            dgvResult.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
            dgvResult.AutoSizeColumns();
            for (int j = 0; j < _sqlBuilder.SelectedNodes.Count; j++)
            {
                //if (dgvResult.RootTable.Columns.Contains(_sqlBuilder.SelectedNodes[j].MyCode))
                //    dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].Caption = _sqlBuilder.SelectedNodes[j].Description;

                if (_sqlBuilder.SelectedNodes[j].Agregate != "")
                {
                    if (dgvResult.RootTable.Columns.Contains(_sqlBuilder.SelectedNodes[j].MyCode))
                    {
                        switch (_sqlBuilder.SelectedNodes[j].Agregate)
                        {
                        case "SUM":
                            dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Sum;
                            break;

                        case "COUNT":
                            dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Count;
                            break;

                        case "AVG":
                            dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Average;
                            break;

                        case "MAX":
                            dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Max;
                            break;

                        case "MIN":
                            dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].MyCode].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Min;
                            break;
                        }
                    }
                    else
                    {
                        if (dgvResult.RootTable.Columns.Contains(_sqlBuilder.SelectedNodes[j].Description))
                        {
                            switch (_sqlBuilder.SelectedNodes[j].Agregate)
                            {
                            case "SUM":
                                dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].Description].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Sum;
                                break;

                            case "COUNT":
                                dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].Description].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Count;
                                break;

                            case "AVG":
                                dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].Description].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Average;
                                break;

                            case "MAX":
                                dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].Description].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Max;
                                break;

                            case "MIN":
                                dgvResult.RootTable.Columns[_sqlBuilder.SelectedNodes[j].Description].AggregateFunction = Janus.Windows.GridEX.AggregateFunction.Min;
                                break;
                            }
                        }
                    }
                }
            }
            for (int i = 0; i < dgvResult.RootTable.Columns.Count; i++)
            {
                //dgvResult.RootTable.Columns[i].AutoSizeMode = Janus.Windows.GridEX.ColumnAutoSizeMode.DisplayedCellsAndHeader;
                if (dgvResult.RootTable.Columns[i].DataTypeCode == TypeCode.Decimal || dgvResult.RootTable.Columns[i].DataTypeCode == TypeCode.Double)
                {
                    dgvResult.RootTable.Columns[i].FormatString      = dgvResult.RootTable.Columns[i].TotalFormatString = "###,###.##";
                    dgvResult.RootTable.Columns[i].TotalFormatString = "###,###.##";
                }
                // dgvResult.Columns[i].A
            }

            dgvResult.RootTable.GroupTotals = GroupTotals.Always;
            dgvResult.RootTable.TotalRow    = InheritableBoolean.True;
        }