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


C# Worksheet.AutoFitColumn方法代码示例

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


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

示例1: DoTest

        //The custom DoTest method
        public void DoTest()
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");
            //Instantiate a workbook object
            Workbook book = new Workbook();
            //Create a worksheet object and get the first worksheet
            Worksheet sheet1 = book.Worksheets[0];
            //Set the first worksheet to _sheet object
              _sheet = sheet1;

            //Call different custom methods
            //These methods exhibits different conditional formatting types with their custom
            //formattings attributes for MS Excel 2007 .xlsx file format
            AddDefaultIconSet();
            AddIconSet2();
            AddIconSet3();
            AddIconSet4();
            AddIconSet5();
            AddIconSet6();
            AddIconSet7();
            AddIconSet8();
            AddIconSet9();
            AddIconSet10();
            AddIconSet11();
            AddIconSet12();
            AddIconSet13();
            AddIconSet14();
            AddIconSet15();
            AddIconSet16();
            AddIconSet17();
            AddIconSet18();
            AddDefaultColorScale();
            Add3ColorScale();
            Add2ColorScale();
            AddAboveAverage();
            AddAboveAverage2();
            AddAboveAverage3();
            AddTop10_1();
            AddTop10_2();
            AddTop10_3();
            AddTop10_4();
            AddDataBar1();
            AddDataBar2();
            AddContainsText();
            AddNotContainsText();
            AddContainsBlank();
            AddNotContainsBlank();
            AddBeginWith();
            AddEndWith();
            AddContainsError();
            AddNotContainsError();
            AddDuplicate();
            AddUnique();
            AddTimePeriod_1();
            AddTimePeriod_2();
            AddTimePeriod_3();
            AddTimePeriod_4();
            AddTimePeriod_5();
            AddTimePeriod_6();
            AddTimePeriod_7();
            AddTimePeriod_8();
            AddTimePeriod_9();
            AddTimePeriod_10();

            //AutoFit M Column in the worksheet
            _sheet.AutoFitColumn(12);
            //Specify the output file path
            string outfn = dataDir+ "Testoutput.xlsx";
            //Save the excel file
            book.Save(outfn, SaveFormat.Xlsx);
        }
开发者ID:mmunchandersen,项目名称:Aspose_Cells_NET,代码行数:73,代码来源:Program.cs


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