首页
学习
活动
专区
圈层
工具
发布
共 23 篇文章
1
用 pdfplumber 从 PDF 提取表格数据(附完整代码)
2
用 pandas 自动生成银行余额调节表(附完整代码)
3
用 pandas 做多维度数据透视分析(pivot_table 实战,附完整代码)
4
用 pandas 自动检测银行流水中的异常交易(附完整代码)
5
用 pandas 自动算科目余额的同比与环比变动(附完整代码)
6
用 Python 自动测算固定资产折旧(直线法实战,附完整代码)
7
用 pandas 快速筛查异常会计分录(附完整代码)
8
Python 偿债能力综合预警:负债率 + 流动比率 + 利息保障
9
Python 审计自动化工具箱 102 篇速查总目录(收官)
10
Python 审计报告附注自动生成(从审定数一键出注释)
11
Python 现金流断裂预警:自由现金流与短债覆盖
12
Python 审计底稿自动排版(页眉页脚页码冻结一键设)
13
Python 多 Excel 工作簿批量合并与汇总
14
Python 财务异常检测:统计离群点自动筛查
15
Python 毛利率同业对标分析(行业基准导入与偏离预警)
16
Python 截止性测试自动化(收入费用跨期抽凭)
17
Python 内控缺陷识别矩阵(控制活动评价指标化)
18
Python 银行流水聚类识别潜在关联方
19
Python 实体经营风险预警:营收与经营现金流背离
20
Python 审计项目工时与排期优化(负荷与甘特)
21
Python 审计风险预警 Dashboard:从底稿数据自动出风险热力表
22
Python 审计调整分录异常预警(频繁调整=盈余管理信号)
23
Python 关键审计事项(KAM)自动提取与预警

Python 审计底稿自动排版(页眉页脚页码冻结一键设)

{"type":"doc","content":[{"type":"paragraph","attrs":{"id":"39379077-f4f8-472b-90ff-5a3ddcc0d0a4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"问题"},{"type":"hardBreak","attrs":{"id":"352fdd17-d91c-4429-860b-7bc922a0746f"}},{"type":"text","text":"底稿交稿前要统一排版:加页眉“被审计单位”、页脚“第X页/共Y页”、冻结首行、设打印区域和列宽。几百张表手工点很累。用 openpyxl 批量设置。"}]},{"type":"paragraph","attrs":{"id":"c8d27e5c-3fe0-4a1e-af2e-1e64c806d3c5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"示例代码"}]},{"type":"paragraph","attrs":{"id":"62520b3c-2225-429b-91c5-6e4a2005527d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"plaintext"}]},{"type":"codeBlock","attrs":{"id":"eae73934-d137-4d2f-9bc1-441153d587f7","language":"javascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"javascript"},"content":[{"type":"text","text":"import openpyxl\n\ndef format_sheet(ws, unit_name):\n ws.freeze_panes = \"A2\"\n ws.print_title_rows = \"1:1\"\n ws.page_setup.orientation = \"landscape\"\n ws.page_setup.fitToWidth = 1\n ws.page_margins.left = 0.5\n ws.page_margins.right = 0.5\n ws.header_center = unit_name\n ws.oddFooter.center = \"第 &P 页 / 共 &N 页\"\n ws.sheet_properties.pageSetUpPr.fitToPage = True\n for col in ws.columns:\n ws.column_dimensions[col[0].column_letter].width = 16\n return ws\n\nwb = openpyxl.load_workbook(\"wp.xlsx\")\nfor ws in wb.worksheets:\n format_sheet(ws, \"XX有限公司\")\nwb.save(\"wp_formatted.xlsx\")\n"}]},{"type":"paragraph","attrs":{"id":"fa1b3e10-bcb1-4cac-8889-f04389b602ac","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"关键点"}]},{"type":"bulletList","attrs":{"id":"a810c24a-bcd3-4867-9b03-fbcd35b62aa0","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"9a6473b8-e197-46ef-a36b-36e02996bca6"},"content":[{"type":"paragraph","attrs":{"id":"bc97b145-00fa-482c-9a4d-c796699b447d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"freeze_panes=\"A2\" 冻结首行;print_title_rows 让每页重复表头。"}]}]},{"type":"listItem","attrs":{"id":"067c69d5-4d59-4499-bb08-d1b27770a59e"},"content":[{"type":"paragraph","attrs":{"id":"689f2613-8993-458f-9ac3-b7ce617c3048","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"页脚 &P/&N 是 Excel 内置页码域,打印自动编号,别手填。"}]}]},{"type":"listItem","attrs":{"id":"9f7c6d31-08a3-4b3e-92f5-b1087580c2ef"},"content":[{"type":"paragraph","attrs":{"id":"a5fecc9c-229f-4a7f-a0a8-61decd8214a7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"fitToWidth=1 + pageSetUpPr.fitToPage=True 让宽表缩到一页宽,避免打印被截断。"}]}]}]},{"type":"paragraph","attrs":{"id":"f4d9fd35-2b87-46c4-875e-af1661d2f22f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"小结"},{"type":"hardBreak","attrs":{"id":"19413bb9-c421-43da-8dd3-4eb97aac4850"}},{"type":"text","text":"排版是重复劳动,openpyxl 一个循环全所底稿统一格式,交稿即规范。"}]},{"type":"horizontalRule","attrs":{"id":"f791f2a6-bfdf-43c6-a655-782483a6c79f","isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"f563fa53-6a50-4d35-a534-6db6db44e368","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你所底稿排版最乱的是页脚页码还是列宽?评论区交流。"}]},{"type":"paragraph","attrs":{"id":"6696e2cf-2a46-4a54-ad51-20159c7b0789","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"如果有用,点赞收藏关注,留下审计难题。下期预告:多 Excel 工作簿批量合并与汇总。"}]},{"type":"paragraph","attrs":{"id":"e1bf4a3d-587c-408b-b2b5-44fe19f62249","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"会计师事务所的一名注册会计师"}]}]}

下一篇
举报
领券