码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 如何:设置页边距


    如何:指定打印设置

    1. // Set page orientation to landscape.
    2. worksheet.ActiveView.Orientation = PageOrientation.Landscape;
    3. // Select paper size.
    4. worksheet.ActiveView.PaperKind = System.Drawing.Printing.PaperKind.A4;
    5. // Access an object that contains print options.
    6. WorksheetPrintOptions printOptions = worksheet.PrintOptions;
    7. // Do not print gridlines.
    8. printOptions.PrintGridlines = false;
    9. // Scale the worksheet to fit within the width of one page.
    10. printOptions.FitToPage = true;
    11. printOptions.FitToWidth = 1;
    12. // Print in black and white.
    13. printOptions.BlackAndWhite = true;
    14. // Print a dash instead of a cell error message.
    15. printOptions.ErrorsPrintMode = ErrorsPrintMode.Dash;

    如何:定义打印区域

    1. // Define a print area on a worksheet.
    2. CellRange printArea = worksheet["B1:F39"];
    3. worksheet.SetPrintRange(printArea);
    4. // Enlarge the print area by adding adjacent cells.
    5. // An additional print area is created if you add non-adjacent cells to the print area.
    6. worksheet.AddPrintRange(worksheet["B40:F50"]);
    7. // Uncomment the following line to clear the print area and print the entire worksheet.
    8. // worksheet.ClearPrintRange();

    如何:在工作表中插入分页符

    1. // Insert a page break after the "F" column.
    2. worksheet.VerticalPageBreaks.Add(6);
    3. // Insert a page break below the 14th row.
    4. worksheet.HorizontalPageBreaks.Add(14);

    Use the Worksheet.ActiveView property to specify the following page options:

    PropertyDescription
    WorksheetView.Margins定义页边距
    WorksheetView.Orientation指定页面方向。
    WorksheetView.PaperKind指定纸张大小。
    WorksheetView.SetCustomPaperSize指定工作表的自定义纸张大小。

    Use the Worksheet.PrintOptions property to configure print options. Print options include the following:

    PropertyDescription
    WorksheetPrintOptions.FitToPage指示是否缩放工作表以使其数据适合指定页数。
    WorksheetPrintOptions.FitToWidth指定工作表应水平容纳的页数。
    WorksheetPrintOptions.FitToHeight指定工作表在垂直方向上应容纳的页数。
    WorksheetPrintOptions.Scale指定缩放工作表内容的百分比。
    WorksheetPrintOptions.PrintGridlines指定是否打印工作表网格线。
    WorksheetPrintOptions.PrintHeadings指定是否打印行标题和列标题。
    WorksheetPrintOptions.PrintTitles允许您在打印页面上重复特定的行和列。
    WorksheetPrintOptions.BlackAndWhite允许您以黑白方式打印工作表。
    WorksheetPrintOptions.PageOrder指定打印页面的顺序。
    WorksheetPrintOptions.PageNumbering允许您指定第一页码。
    WorksheetPrintOptions.CenterHorizontally指定是否在打印页面上水平居中数据。
    WorksheetPrintOptions.CenterVertically指定是否在打印页面上垂直居中数据。
    WorksheetPrintOptions.ErrorsPrintMode指定如何打印单元格错误。

    如何:设置页边距

    1. // Set the page orientation to Landscape.
    2. workbook.Worksheets[0].ActiveView.Orientation = PageOrientation.Landscape;


    自定义纸张尺寸

  • 相关阅读:
    ET.parse().getroot()
    PostgresSQL思维导图
    顺序表(下)
    [算法1-排序](.NET源码学习)& LINQ & Lambda
    Simple Linear Regression:ONE
    UML设计系列(8):用例图
    手记系列之二 ----- 关于IDEA的一些使用方法经验
    【数据结构】c++栈的应用:波兰式、逆波兰式和中缀表达式计算器
    图文解释各种电阻阻值的读取方法【硬件篇】
    nmap之nse脚本简单学习
  • 原文地址:https://blog.csdn.net/wushijun5200/article/details/128194978
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号