![]() ![]() SetPrintArea ( 0, 1, 2, 0, 3 ) FileStream sw = File. SetRepeatingRowsAndColumns ( 1, 4, 5, 1, 2 ) //set the print area for the first sheet If I want to print out the values from cell A9 through D13 instead of the entire worksheet, then I can select those cells, A9 through D13, and then on the page. SetRepeatingRowsAndColumns ( 0, 0, 2, - 1, - 1 ) // Set the the repeating rows and columns on the second sheet. ![]() SetCellValue ( 2.5 ) // Set the columns to repeat from column 0 to 2 on the first sheet CreateSheet ( "second sheet" ) // Set the columns to repeat from column 0 to 2 on the first sheet CreateSheet ( "new sheet" ) ISheet sheet2 = wb. To view the print area selections, go to the View tab and click on. After that, go to the Page Layout tab and click on the Print Area icon and then select the Set Print Area option. IWorkbook wb = new XSSFWorkbook () ISheet sheet1 = wb. First, select the single cells range or the multiple cells ranges using the Control key that you want to set a print area in the sheet. tPrintArea method is available to set page properties of print area. Click the drop-down menu and select 'Set Print Area.' Set multiple. Navigate to the 'Page Setup' bu on the menu ribbon and click the 'Page Layout' tab. Save ( "test.xlsx" ) NPOI - HSSF XSSF - Set Print Area Follow these steps to learn how to set the print area in an Excel worksheet: Select the part of the worksheet you want to print. ![]() PageSetup // Specifying the cells range (from A1 cell to F20 cell) of the print area Worksheets // Obtaining the reference of the PageSetup of the worksheet Value = 2.5 // Accessing the first worksheet in the Workbook file Add ( "second sheet" ) Worksheet sheet1 = workbook. The printed data will not exceed your specifications, but the data will not expand to fill any empty space.Workbook workbook = new Workbook () workbook. When you change the values for Fit to, the data will shrink to fit the specified number of pages. If you have set any manual page breaks, these will be ignored when you use the ‘fit to’ option To view how the data will look on the page, view a print preview first Now all you need to do is print as normal. On the Page Layout tab > Page Setup group > Orientation > choose either ‘ Portrait’ or ‘ Landscape’ When you need to print only a limited range of worksheet data, Microsoft Excel 2010 offers a Set Print Area option to help you manage your print content. In order to use this setting, the height and width options must be set to automatic.ĭepending upon the size and shape of your data, it may be better to change the orientation of the page to print your spreadsheet landscape rather than portrait. Scale the dataĪlternatively, in the same group settings here you can set the ‘scale’ percentage, which is set to 100% by default, to stretch or shrink your data to a percentage of it’s actual size. In Excel of Office 365 the Print Area in the Page Setup/ Sheet / Print Area is grayed out. Note: you will see the the ‘scale’ option is greyed out once you have changed settings for the width and height – the percentage will be altered automatically for best fit to your requirements. MA MAK5551 Created on ApSet the Print Area In earlier versions of Excel, one could set the print area via Page Setup/ Sheet / Print Area and one could put in a string like 'A1:K63'. In this example, we want the data to fit one A4 page, so we will select 1 page wide and 1 page high as in the example below. By default these are set to ‘automatic’ but if you click the dropdown arrows here you are able to choose how many pages high or wide you want your data to be. There are two dropdown boxes – one for width and one for height. On the Page Layout tab > Scale to fit group you will see a number of options Define the number of pages to print onįirst, open the worksheet the you want to print ![]() Now and again you might want to print out the contents of a spreadsheet worksheet, perhaps for an attendance list or address database for an event.Įxcel spreadsheets don’t really have default settings to have them print nicely on a standard A4 page, as you might find in Word, and you will have probably experienced the issue of printing your spreadsheet to find the rows split over multiple pages – often wasting paper and making the information hard to read.īy scaling a worksheet in page setup before you print, you can control its width and number of pages, there are two ways of doing this: 1. ![]()
0 Comments
Leave a Reply. |