如何在jasper报告中设置print excel文件 [英] How to setup print excel files in jasper reports
本文介绍了如何在jasper报告中设置print excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
HSSFPrintSetup printSetup = sheet.getPrintSetup();
sheet.getPrintSetup()。setFitWidth((short)1);
sheet.getPrintSetup()。setFitHeight((short)0);
sheet.setAutobreaks(true);
printSetup.setLandscape(true);
HSSFFooter footer = sheet.getFooter();
footer.setCenter(Page+ HSSFFooter.page()+of+ HSSFFooter.numPages());
i have problem with my excel when i print preview the files after i export the report into excel. How to setup the files when i print the files, it will automatic fix the size according the A4 paper?.
解决方案
HSSFPrintSetup printSetup = sheet.getPrintSetup();
sheet.getPrintSetup().setFitWidth((short) 1);
sheet.getPrintSetup().setFitHeight((short) 0);
sheet.setAutobreaks(true);
printSetup.setLandscape(true);
HSSFFooter footer = sheet.getFooter();
footer.setCenter("Page " + HSSFFooter.page() + " of "+ HSSFFooter.numPages());
这篇关于如何在jasper报告中设置print excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文