예제 #1
0
파일: Excel.cs 프로젝트: techcap/CSharp
        public void SetRangeDataVet(int Pi_Row, int Pi_Col, object[,] Po_Value, EM_EXCEL_HALIGN Pe_HAlign, EM_EXCEL_VALIGN Pe_VAlign)
        {
            Excel.Range Le_Range = null;
            Le_Range = Mws_Sheet.get_Range(Mws_Sheet.Cells[Pi_Row, Pi_Col], Mws_Sheet.Cells[Pi_Row + Po_Value.GetLength(0) - 1, Pi_Col + Po_Value.GetLength(1) - 1]);
            Le_Range.set_Value(Missing.Value, Po_Value);

            Le_Range.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;

            Le_Range.HorizontalAlignment = Pe_HAlign;
            Le_Range.VerticalAlignment   = Pe_VAlign;


            Le_Range.EntireRow.AutoFit();
            Le_Range.EntireColumn.AutoFit();

            Le_Range.WrapText = false;

            Le_Range.Font.Bold = Mf_Font.Bold;
            Le_Range.Font.Size = Mf_Font.Size;
        }
예제 #2
0
파일: Excel.cs 프로젝트: techcap/CSharp
        public void SetText(int Pi_Row, int Pi_Col, object Po_Value, Color Pc_BackColor, Color Pc_ForeColor, EM_EXCEL_HALIGN Pe_HAlign, EM_EXCEL_VALIGN Pe_VAlign)
        {
            Excel.Range Le_Range = null;
            try
            {
                Le_Range = Mws_Sheet.get_Range(Mws_Sheet.Cells[Pi_Row, Pi_Col], Mws_Sheet.Cells[Pi_Row, Pi_Col]);

                Le_Range.Font.Bold = Mf_Font.Bold;
                Le_Range.Font.Size = Mf_Font.Size;

                Le_Range.Interior.Color = ColorTranslator.ToOle(Pc_BackColor);
                Le_Range.Font.Color     = ColorTranslator.ToOle(Pc_ForeColor);

                Le_Range.HorizontalAlignment = Pe_HAlign;
                Le_Range.VerticalAlignment   = Pe_VAlign;

                Le_Range.Value2 = Po_Value;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (Le_Range != null)
                {
                    Marshal.ReleaseComObject(Le_Range);
                }
            }
        }
예제 #3
0
파일: Excel.cs 프로젝트: techcap/CSharp
 public void SetText(int Pi_Row, int Pi_Col, object Po_Value, EM_EXCEL_HALIGN Pe_HAlign)
 {
     SetText(Pi_Row, Pi_Col, Po_Value, Color.Transparent, Color.Black, Pe_HAlign, EM_EXCEL_VALIGN.xlVAlignCenter);
 }