Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我与 POI 合作并希望制作可打印的报告。所以一切都很好,但我需要获取动态生成的总页数(A4 格式的页面).xls。使用时HeaderFooter.numPages(),我得到的不是总页数,而是这个符号: &N
.xls
HeaderFooter.numPages()
&N
@Gagravarr 是正确的。由于存储了要打印的页数,因此实际上没有办法从 Apache POI 访问它。我建议将excel文件切换为PDF并按照建议的方式计算它。