Exemplo n.º 1
0
        private void setDefaultGrid(AxFPUSpreadADO.AxfpSpread arg_grid)
        {
            // Set Default Grid
            arg_grid.Visible = false;

            arg_grid.Reset();
            arg_grid.BorderStyle              = FPUSpreadADO.BorderStyleConstants.BorderStyleNone;
            arg_grid.DisplayColHeaders        = false;
            arg_grid.DisplayRowHeaders        = false;
            arg_grid.ActiveCellHighlightStyle = FPUSpreadADO.ActiveCellHighlightStyleConstants.ActiveCellHighlightStyleOff;
            arg_grid.GrayAreaBackColor        = Color.White;
            // arg_grid.ScrollBarExtMode = true;
            arg_grid.ColHeaderRows = 0;
            arg_grid.ScrollBars    = FPUSpreadADO.ScrollBarsConstants.ScrollBarsHorizontal;
            arg_grid.Font          = new System.Drawing.Font("Calibri", 11);
            arg_grid.set_RowHeight(1, 0.5);
            arg_grid.set_ColWidth(1, 0.5);
            arg_grid.TypeHAlign        = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
            arg_grid.TypeVAlign        = FPUSpreadADO.TypeVAlignConstants.TypeVAlignCenter;
            arg_grid.TypeEditMultiLine = true;
            arg_grid.SetCellBorder(1, 1, 150, arg_grid.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
            arg_grid.SetCellBorder(1, 1, 150, arg_grid.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);

            for (int ic = 2; ic <= 150; ic++)
            {
                arg_grid.set_ColWidth(ic, 4.2);
            }
        }
Exemplo n.º 2
0
        private void DisplayGridTop(DataTable arg_dt, AxFPUSpreadADO.AxfpSpread arg_grid)
        {
            try
            {
                _Dic_Location = new Dictionary <string, string>();

                if (arg_dt == null || arg_dt.Rows.Count == 0)
                {
                    return;
                }

                Double.TryParse(arg_dt.Rows[0]["WIDTH"].ToString(), out _iWidth);
                Double.TryParse(arg_dt.Rows[0]["HEIGHT"].ToString(), out _iHeight);

                // Set Default Grid
                arg_grid.Visible = false;

                arg_grid.Reset();
                arg_grid.BorderStyle              = FPUSpreadADO.BorderStyleConstants.BorderStyleNone;
                arg_grid.DisplayColHeaders        = false;
                arg_grid.DisplayRowHeaders        = false;
                arg_grid.ActiveCellHighlightStyle = FPUSpreadADO.ActiveCellHighlightStyleConstants.ActiveCellHighlightStyleOff;
                arg_grid.ColHeaderRows            = 0;
                arg_grid.ScrollBars = FPUSpreadADO.ScrollBarsConstants.ScrollBarsNone;
                arg_grid.Font       = new System.Drawing.Font("Calibri", 8);
                arg_grid.set_RowHeight(1, 0.5);
                arg_grid.set_ColWidth(1, 0.5);
                arg_grid.TypeHAlign        = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
                arg_grid.TypeVAlign        = FPUSpreadADO.TypeVAlignConstants.TypeVAlignCenter;
                arg_grid.TypeEditMultiLine = true;

                arg_grid.SetCellBorder(1, 1, 150, axGridTop.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                arg_grid.SetCellBorder(1, 1, 150, axGridTop.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                for (int ic = 2; ic <= 150; ic++)
                {
                    arg_grid.set_ColWidth(ic, 3.1);
                }

                int row_s = 2;
                int irow  = row_s;
                int icol  = 2;

                MachineHeadTop(icol, irow, 0, arg_dt, arg_grid);
                irow = row_s + 1;
                MachineBodyTop(icol, irow, 0, arg_dt, arg_grid);
                _Dic_Location.Add(irow.ToString() + "-" + icol.ToString(), arg_dt.Rows[0]["SHORT_NAME"].ToString());
                for (int i = 1; i < arg_dt.Rows.Count; i++)
                {
                    if (arg_dt.Rows[i]["LINE_ID"].ToString() == arg_dt.Rows[i - 1]["LINE_ID"].ToString())
                    {
                        if (arg_dt.Rows[i]["MINI_LINE_ID"].ToString() == arg_dt.Rows[i - 1]["MINI_LINE_ID"].ToString())
                        {
                            irow++;
                        }
                        else
                        {
                            irow = row_s + 1;
                            icol++;
                        }
                        MachineBodyTop(icol, irow, i, arg_dt, arg_grid);
                    }
                    else
                    {
                        axGridTop.set_ColWidth(icol + 1, 0.4);
                        icol += 2;
                        irow  = row_s;
                        MachineHeadTop(icol, irow, i, arg_dt, arg_grid);
                        irow = row_s + 1;
                        MachineBodyTop(icol, irow, i, arg_dt, arg_grid);
                    }

                    string loc = irow.ToString() + "-" + icol.ToString();

                    //for (int i = 0; i < _Dic_Location.Count; i++)
                    //{
                    //    _Dic_Location.
                    //}

                    _Dic_Location.Add(loc, arg_dt.Rows[i]["SHORT_NAME"].ToString());
                }

                arg_grid.RowsFrozen = irow + 1;
            }
            catch
            { }
            finally
            {
                arg_grid.Visible = true;
            }
        }
Exemplo n.º 3
0
        private void DisplayGridRight(DataTable arg_dt, AxFPUSpreadADO.AxfpSpread arg_grid)
        {
            int irow = 1, icol = 0;
            int iTotInput = 0, iTotMold = 0, iInput = 0, iMold = 0;
            int divRow = 11;

            arg_grid.Reset();
            //arg_grid.BorderStyle = FPUSpreadADO.BorderStyleConstants.BorderStyleNone;
            arg_grid.GrayAreaBackColor        = Color.White;
            arg_grid.DisplayColHeaders        = false;
            arg_grid.DisplayRowHeaders        = false;
            arg_grid.ActiveCellHighlightStyle = FPUSpreadADO.ActiveCellHighlightStyleConstants.ActiveCellHighlightStyleOff;
            arg_grid.ColHeaderRows            = 0;
            arg_grid.ScrollBars = FPUSpreadADO.ScrollBarsConstants.ScrollBarsNone;
            arg_grid.Font       = new System.Drawing.Font("Calibri", 11);
            //arg_grid.set_RowHeight(1, 0.5);
            //arg_grid.set_ColWidth(1, 0.5);
            arg_grid.TypeHAlign        = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
            arg_grid.TypeVAlign        = FPUSpreadADO.TypeVAlignConstants.TypeVAlignCenter;
            arg_grid.TypeEditMultiLine = true;

            arg_grid.Row      = 1;
            arg_grid.FontBold = true;



            //for (int ic = 1; ic <= 50; ic++)
            //    arg_grid.set_ColWidth(ic, 12);

            for (int ir = 1; ir <= divRow; ir++)
            {
                arg_grid.set_RowHeight(ir, 15);
            }

            // arg_grid.set_RowHeight(1, 22);
            arg_grid.set_RowHeight(divRow + 1, 18);

            GridRightHead(1, arg_grid);
            arg_grid.SetCellBorder(1, 1, arg_grid.MaxCols, divRow + 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0x4286f4, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
            arg_grid.SetCellBorder(1, 1, arg_grid.MaxCols, divRow + 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0x4286f4, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
            for (int i = 0; i < arg_dt.Rows.Count; i++)
            {
                if (irow == divRow)
                {
                    icol += 4;
                    irow  = 2;
                    GridRightHead(icol + 1, arg_grid);
                    arg_grid.set_ColWidth(icol, 2);
                    arg_grid.SetCellBorder(icol, 1, icol, divRow - 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                    //arg_grid.SetCellBorder(irow , icol , 4, divRow, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
                    // arg_grid.SetCellBorder(irow , icol, 4, divRow, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
                }
                else
                {
                    irow++;
                }

                iInput = Convert.ToInt32(arg_dt.Rows[i]["MOLD_INPUT"]);
                iMold  = Convert.ToInt32(arg_dt.Rows[i]["QTY"]);

                arg_grid.SetText(icol + 1, irow, arg_dt.Rows[i]["SHORT_NAME"].ToString());
                arg_grid.SetText(icol + 2, irow, iMold.ToString("###,###,###"));
                arg_grid.SetText(icol + 3, irow, iInput.ToString("###,###,###"));

                iTotInput += Convert.ToInt32(arg_dt.Rows[i]["MOLD_INPUT"]);
                iTotMold  += Convert.ToInt32(arg_dt.Rows[i]["QTY"]);
            }

            arg_grid.AddCellSpan(1, divRow + 1, 13, 1);

            arg_grid.SetText(1, divRow + 1, "Total");
            arg_grid.SetText(icol + 3, divRow + 1, iTotInput.ToString("###,###,###"));
            arg_grid.SetText(icol + 2, divRow + 1, iTotMold.ToString("###,###,###"));
            arg_grid.Col        = -1;
            arg_grid.Row        = divRow + 1;
            arg_grid.BackColor  = Color.FromArgb(232, 232, 127);
            arg_grid.FontBold   = true;
            arg_grid.FontSize   = 14;
            arg_grid.Col        = 1;
            arg_grid.TypeHAlign = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
            arg_grid.MaxRows    = divRow + 1;
            arg_grid.MaxCols    = 15;
        }
Exemplo n.º 4
0
        private void DisplayGridLeft(DataTable arg_dt, AxFPUSpreadADO.AxfpSpread arg_grid)
        {
            int irow = 1, icol = 0, divRow;
            int iTotMachine = 0, iTotInput = 0, iTotBal = 0;

            arg_grid.Reset();
            // arg_grid.BorderStyle = FPUSpreadADO.BorderStyleConstants.BorderStyleNone;
            arg_grid.GrayAreaBackColor        = Color.White;
            arg_grid.DisplayColHeaders        = false;
            arg_grid.DisplayRowHeaders        = false;
            arg_grid.ActiveCellHighlightStyle = FPUSpreadADO.ActiveCellHighlightStyleConstants.ActiveCellHighlightStyleOff;
            arg_grid.ColHeaderRows            = 0;
            arg_grid.ScrollBars = FPUSpreadADO.ScrollBarsConstants.ScrollBarsNone;
            arg_grid.Font       = new System.Drawing.Font("Calibri", 11);
            //arg_grid.set_RowHeight(1, 0.5);
            //arg_grid.set_ColWidth(1, 0.5);
            arg_grid.TypeHAlign        = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
            arg_grid.TypeVAlign        = FPUSpreadADO.TypeVAlignConstants.TypeVAlignCenter;
            arg_grid.TypeEditMultiLine = true;

            arg_grid.Row      = 1;
            arg_grid.FontBold = true;


            //for (int ic = 1; ic <= 50; ic++)
            //    arg_grid.set_ColWidth(ic, 12);



            var query = from DataRow dRow in arg_dt.AsEnumerable()
                        //  where p.Used = "N"
                        group dRow by dRow["LINE_NAME"] into gp
                        select new
            {
                Line    = gp.Key,
                Machine = gp.Count(),
                Input   = gp.Count(dRow => dRow.Field <string>("USE_YN") == "Y")
            };

            divRow = (query.Count() / 2) + 2;
            for (int ir = 1; ir <= divRow; ir++)
            {
                arg_grid.set_RowHeight(ir, 15);
            }

            arg_grid.set_RowHeight(divRow + 1, 18);
            arg_grid.MaxCols = 9;
            arg_grid.MaxRows = divRow + 1;
            GridLeftHead(1, arg_grid);

            arg_grid.SetCellBorder(1, 1, arg_grid.MaxCols, divRow + 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0x4286f4, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
            arg_grid.SetCellBorder(1, 1, arg_grid.MaxCols, divRow + 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0x4286f4, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);


            foreach (var element in query)
            {
                if (irow == divRow)
                {
                    icol += 5;
                    irow  = 2;
                    GridLeftHead(icol + 1, arg_grid);
                    arg_grid.set_ColWidth(icol, 2);
                    arg_grid.SetCellBorder(icol, 1, icol, divRow - 1, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                    //arg_grid.SetCellBorder(irow , icol , 4, divRow, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
                    // arg_grid.SetCellBorder(irow , icol, 4, divRow, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleSolid);
                }
                else
                {
                    irow++;
                }

                arg_grid.SetText(icol + 1, irow, element.Line);
                arg_grid.SetText(icol + 2, irow, element.Machine);
                arg_grid.SetText(icol + 3, irow, element.Input);
                arg_grid.SetText(icol + 4, irow, element.Machine - element.Input);

                iTotMachine += element.Machine;
                iTotInput   += element.Input;
                iTotBal     += (element.Machine - element.Input);
            }

            arg_grid.AddCellSpan(1, divRow + 1, 6, 1);

            arg_grid.SetText(1, divRow + 1, "Total");
            arg_grid.SetText(icol + 2, divRow + 1, iTotMachine.ToString());
            arg_grid.SetText(icol + 3, divRow + 1, iTotInput.ToString());
            arg_grid.SetText(icol + 4, divRow + 1, iTotBal.ToString());
            arg_grid.Col       = -1;
            arg_grid.Row       = divRow + 1;
            arg_grid.BackColor = Color.FromArgb(232, 232, 127);
            arg_grid.FontBold  = true;
            arg_grid.FontSize  = 14;
        }
Exemplo n.º 5
0
        private void DisplayGridTop(DataTable arg_dt, AxFPUSpreadADO.AxfpSpread arg_grid)
        {
            try
            {
                if (arg_dt == null || arg_dt.Rows.Count == 0)
                {
                    return;
                }

                // Set Default Grid
                arg_grid.Visible = false;

                arg_grid.Reset();
                arg_grid.BorderStyle              = FPUSpreadADO.BorderStyleConstants.BorderStyleNone;
                arg_grid.DisplayColHeaders        = false;
                arg_grid.DisplayRowHeaders        = false;
                arg_grid.ActiveCellHighlightStyle = FPUSpreadADO.ActiveCellHighlightStyleConstants.ActiveCellHighlightStyleOff;
                arg_grid.ColHeaderRows            = 0;
                arg_grid.ScrollBars = FPUSpreadADO.ScrollBarsConstants.ScrollBarsNone;
                arg_grid.Font       = new System.Drawing.Font("Calibri", 10);
                arg_grid.set_RowHeight(1, 0.5);
                arg_grid.set_ColWidth(1, 0.5);
                arg_grid.TypeHAlign        = FPUSpreadADO.TypeHAlignConstants.TypeHAlignCenter;
                arg_grid.TypeVAlign        = FPUSpreadADO.TypeVAlignConstants.TypeVAlignCenter;
                arg_grid.TypeEditMultiLine = true;
                arg_grid.SetCellBorder(1, 1, 150, axGridTop.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexLeft, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                arg_grid.SetCellBorder(1, 1, 150, axGridTop.MaxRows, FPUSpreadADO.CellBorderIndexConstants.CellBorderIndexBottom, 0, FPUSpreadADO.CellBorderStyleConstants.CellBorderStyleBlank);
                for (int ic = 2; ic <= 150; ic++)
                {
                    arg_grid.set_ColWidth(ic, 4.0);
                }

                int row_s = 2;
                int irow  = row_s;
                int icol  = 2;

                MachineHeadTop(icol, irow, 0, arg_dt, arg_grid);
                irow = row_s + 1;
                MachineBodyTop(icol, irow, 0, arg_dt, arg_grid);
                for (int i = 1; i < arg_dt.Rows.Count; i++)
                {
                    if (arg_dt.Rows[i]["LINE_ID"].ToString() == arg_dt.Rows[i - 1]["LINE_ID"].ToString())
                    {
                        if (arg_dt.Rows[i]["MINI_LINE_ID"].ToString() == arg_dt.Rows[i - 1]["MINI_LINE_ID"].ToString())
                        {
                            irow++;
                        }
                        else
                        {
                            irow = row_s + 1;
                            icol++;
                        }
                        MachineBodyTop(icol, irow, i, arg_dt, arg_grid);
                    }
                    else
                    {
                        axGridTop.set_ColWidth(icol + 1, 0.5);
                        icol += 2;
                        irow  = row_s;
                        MachineHeadTop(icol, irow, i, arg_dt, arg_grid);
                        irow = row_s + 1;
                        MachineBodyTop(icol, irow, i, arg_dt, arg_grid);
                    }
                }
            }
            catch
            { }
            finally
            {
                arg_grid.Visible = true;
            }
        }