当前位置: 首页>>代码示例>>C#>>正文


C# ApplicationClass.set_Visible方法代码示例

本文整理汇总了C#中ApplicationClass.set_Visible方法的典型用法代码示例。如果您正苦于以下问题:C# ApplicationClass.set_Visible方法的具体用法?C# ApplicationClass.set_Visible怎么用?C# ApplicationClass.set_Visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApplicationClass的用法示例。


在下文中一共展示了ApplicationClass.set_Visible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Save_BnOplGroupInXLS

 public void Save_BnOplGroupInXLS(System.DateTime Date)
 {
     try
     {
         object obj2 = System.Reflection.Missing.Value;
         string str = "";
         object obj3 = DALSql.ExecuteScalar("select val from kod_rep", null).ToString();
         if (obj3.ToString() == "1")
         {
             str = "Порт";
         }
         if (obj3.ToString() == "2")
         {
             str = "Соцгород";
         }
         if (obj3.ToString() == "3")
         {
             str = "Центр";
         }
         Application application = new ApplicationClass();
         _Worksheet worksheet = (_Worksheet) application.Workbooks.Add(XlWBATemplate.xlWBATWorksheet).Worksheets.get_Item(1);
         application.set_Visible(true);
         worksheet.Columns.set_ColumnWidth(0x20);
         worksheet.get_Range("A1", obj2).set_Value2(str);
         worksheet.get_Range("A1", obj2).Font.set_Bold(true);
         worksheet.get_Range("C1", obj2).set_Value2("Г. ДИМИТРОВГРАД");
         worksheet.get_Range("C1", obj2).Font.set_Bold(true);
         worksheet.get_Range("B3", obj2).set_Value2("КРАТКАЯ СПРАВКА по безналичному расчету");
         worksheet.get_Range("B3", obj2).Font.set_Bold(true);
         worksheet.get_Range("B1", obj2).set_ColumnWidth(14);
         worksheet.get_Range("B4", obj2).set_Value2("за " + Date.ToString("MMMM yyyy"));
         worksheet.get_Range("B4", obj2).Font.set_Bold(true);
         worksheet.get_Range("A5", obj2).set_Value2("Наименование группы услуг");
         worksheet.get_Range("A5", obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         worksheet.get_Range("B5", obj2).set_Value2("Кол-во л/счетов");
         worksheet.get_Range("B5", obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         worksheet.get_Range("C5", obj2).set_Value2("Cумма для безналичного удержания");
         worksheet.get_Range("C5", obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         System.DateTime time = new System.DateTime(Date.get_Year(), Date.get_Month(), 1, 0, 0, 0, 0);
         System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@d_prd", System.Data.SqlDbType.DateTime) };
         parameters[0].set_Value(time);
         System.Data.DataTable table = DALSql.ExecuteDataTable("\r\n                select gr,count(*) ls,sum(summa) summa from bn \r\n                where [email protected]_prd group by gr order by gr", parameters);
         int num = 0;
         System.Data.DataRow row = null;
         if (table.Rows.get_Count() > 0)
         {
             for (int i = 0; i < table.Rows.get_Count(); i = (int) (i + 1))
             {
                 row = table.Rows.get_Item(i);
                 int num3 = (int) (6 + i);
                 worksheet.get_Range("A" + ((int) num3).ToString(), obj2).set_Value2(row.get_Item("gr").ToString());
                 int num4 = (int) (6 + i);
                 worksheet.get_Range("A" + ((int) num4).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
                 int num5 = (int) (6 + i);
                 worksheet.get_Range("B" + ((int) num5).ToString(), obj2).set_Value2(row.get_Item("ls").ToString());
                 int num6 = (int) (6 + i);
                 worksheet.get_Range("B" + ((int) num6).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
                 int num7 = (int) (6 + i);
                 worksheet.get_Range("C" + ((int) num7).ToString(), obj2).EntireColumn.set_NumberFormatLocal("0,00");
                 int num8 = (int) (6 + i);
                 worksheet.get_Range("C" + ((int) num8).ToString(), obj2).set_Value2(System.Convert.ToDecimal(row.get_Item("summa").ToString()));
                 int num9 = (int) (6 + i);
                 worksheet.get_Range("C" + ((int) num9).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
                 num = i;
             }
         }
         int num10 = (int) (7 + num);
         worksheet.get_Range("A" + ((int) num10).ToString(), obj2).set_Value2("ИТОГО");
         int num11 = (int) (7 + num);
         worksheet.get_Range("A" + ((int) num11).ToString(), obj2).Font.set_Bold(true);
         int num12 = (int) (7 + num);
         worksheet.get_Range("A" + ((int) num12).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         int num13 = (int) (7 + num);
         worksheet.get_Range("B" + ((int) num13).ToString(), obj2).Select();
         int num14 = (int) (7 + num);
         worksheet.get_Range("B" + ((int) num14).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         int num15 = (int) (7 + num);
         worksheet.get_Range("B" + ((int) num15).ToString(), obj2).Font.set_Bold(true);
         int num16 = (int) (6 + num);
         application.ActiveCell.set_Formula("=СУММ(B6:B" + ((int) num16).ToString() + ")");
         int num17 = (int) (7 + num);
         worksheet.get_Range("C" + ((int) num17).ToString(), obj2).Select();
         int num18 = (int) (7 + num);
         worksheet.get_Range("C" + ((int) num18).ToString(), obj2).BorderAround(XlLineStyle.xlContinuous, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic, null);
         int num19 = (int) (7 + num);
         worksheet.get_Range("C" + ((int) num19).ToString(), obj2).Font.set_Bold(true);
         int num20 = (int) (6 + num);
         application.ActiveCell.set_Formula("=СУММ(C6:C" + ((int) num20).ToString() + ")");
         int num21 = (int) (9 + num);
         worksheet.get_Range("A" + ((int) num21).ToString(), obj2).set_Value2("Директор ДФ ООО \"РИЦ\"");
         int num22 = (int) (9 + num);
         worksheet.get_Range("A" + ((int) num22).ToString(), obj2).Font.set_Bold(true);
         int num23 = (int) (9 + num);
         worksheet.get_Range("C" + ((int) num23).ToString(), obj2).set_Value2("Малиновская Н Е");
         int num24 = (int) (9 + num);
         worksheet.get_Range("C" + ((int) num24).ToString(), obj2).Font.set_Bold(true);
     }
     catch (System.Exception exception)
     {
         throw new System.ApplicationException("Произошла ошибка выгрузки", exception);
//.........这里部分代码省略.........
开发者ID:u4097,项目名称:SQLScript,代码行数:101,代码来源:ExportMapper.cs


注:本文中的ApplicationClass.set_Visible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。