|Printing all sheets of workbook|
Printing all sheets of workbook 2007-05-09 - By Tahir Akhtar
I am using poi-3 (See http://poi-3.ora-code.com).0-alpha-3 (See http://pha-3.ora-code.com). My users want to be able to print all the
worksheets in the workbook. I attempted to solve this issue by setting all
the worksheets of workbook as selected using following code
The workbook when opened in excel has all the sheets are correctly selected
as indicated by color of sheet name at the bottom of window.
The problem is that when user hits ctrl-p , the contents of only the first
sheet print even though all the sheets have been selected.
In the "Print What" section of Print Properties dialog, 'Active sheet(s)'
option is selected by default. Even if I select 'Entire workbook' option I
get the same result i.e only the contents of the first sheet gets printed.
Interestingly if I create a workbook directly in excel and set all sheets as
selected by ctrl-clicking on sheet name, all sheets print fine.
Any help would be highly appreciated.