1

My web app uses the Java Excel API 2.6.10 (http://jexcelapi.sourceforge.net/) to generate .xls spreadsheets dynamically. The user clicks a link and can either open or save the spreadsheet. Works fine.

The slight annoyance is that when the spreadsheet opens, it is pretty small (in terms of its physical width x height dimensions) and the user always has to resize the sheet manually.

Is there a way to specify that I want the spreadsheet to have some given width and height when the user opens it? I'm guessing that either the API allows me to specify the initial dimensions or else there's some way to pass that information with the HTML link itself, but I'm not seeing anything.

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

1

Does this do what you need:

Window window = workbook.getWindow();        
window.setHeight(450);
window.setWidth(600);

Found it from this website: http://www.teamdev.com/downloads/jexcel/docs/JExcel-PGuide.html#AEN182

Hope that helps!

-Justin

Justin Self
  • 6,137
  • 3
  • 33
  • 48
  • Thanks Justin. I guess there are a couple of APIs with nearly identical names. I don't think that's the same API, and the API I'm using ("Java Excel API" instead of "JExcel") doesn't have the getWindow() method. But I'll look around for something similar. Worst case I can switch over to the API you mention. Thanks. –  Aug 19 '11 at 05:35