1

I have created Excel file using "HSSFWorkbook" in my project.

Whenever the user opens the Excel file it should display in "Page Layout" view i.e. the user should able to view entire page info including header, footer. However, I have tried in different ways but I couldn't do.

Simon Adcock
  • 3,554
  • 3
  • 25
  • 41
user2940073
  • 79
  • 1
  • 1
  • 5

1 Answers1

0

Its not much clear for me, but if you want to fit the entire sheet in one page then you should do something like:

Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet("format sheet");
PrintSetup ps = sheet.getPrintSetup();

sheet.setAutobreaks(true);

ps.setFitHeight((short)1);
ps.setFitWidth((short)1);
Sankumarsingh
  • 9,889
  • 11
  • 50
  • 74