Do you have a good knowledge in Apache POI PPT? Then you are at the right place in getting a good Apache POI PPT jobs. Several leading companies are hiring on the Apache POI PPT. Apache POI is a popular API that allows programmers to create, modify, and display MS-Office files using Java programs. There are various leading companies that for job positions like Reports Developer, Core Java Developer, Software Development Engineer III, Software Development Engineer II, Senior Software Engineer, Senior Java Developer, Core Java Software Engineer, IoT Edge Developer(Java), MW/ Java Developer, POI tools Engineer, Import Leads POI Tools and many more. To gain more knowledge on Apache POI PPT Interview Questions and Answers do visit our website Wisdomjobs.com.
Question 1. What Is Apache Poi?
Answer :
Apache POI is a popular API that allows programmers to create, modify, and display MS Office files using Java programs. It is an open source library developed and distributed by Apache Software Foundation to design or modify Microsoft Office files using Java program. It contains classes and methods to decode the user input data or a file into MS Office documents.
Question 2. Name Some Of The Components Of Apache Poi?
Answer :
Components of Apache POI:
Apache POI contains classes and methods to work on all OLE2 Compound documents of MS Office. The list of components of this API is given below.
POIFS (Poor Obfuscation Implementation File System) − This component is the basic factor of all other POI elements. It is used to read different files explicitly.
Question 3. What Is The Purpose Of Hssfworkbook Class In Apache Poi?
Answer :
It is a high-level class under the org.apache.poi.hssf.usermodel package. It implements the Workbook interface and is used for Excel files in .xls format.
Question 4. What Is The Purpose Of Xssfworkbook Class In Apache Poi?
Answer :
It is a class that is used to represent both high and low level Excel file formats. It belongs to the org.apache.xssf.usemodel package and implements the Workbook interface.
Question 5. What Is The Purpose Of Hssfsheet Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.hssf.usermodel package. It can create excel spreadsheets and it allows to format the sheet style and sheet data.
Question 6. What Is The Purpose Of Xssfsheet Class In Apache Poi?
Answer :
This is a class which represents high level representation of excel spreadsheet. It is under org.apache.poi.hssf.usermodel package.
Question 7. What Is The Purpose Of Xssfrow Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It implements the Row interface, therefore it can create rows in a spreadsheet.
Question 8. What Is The Purpose Of Xssfcell Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It implements the Cell interface. It is a high-level representation of cells in the rows of a spreadsheet.
Question 9. What Is The Purpose Of Xssfcellstyle Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It will provide possible information regarding the format of the content in a cell of a spreadsheet. It also provides options for modifying that format. It implements the CellStyle interface.
Question 10. What Is The Purpose Of Hssfcolor Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.hssf.util package. It provides different colors as nested classes. Usually these nested classes are represented by using their own indexes. It implements the Color interface.
Question 11. What Is The Purpose Of Xssffont Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It implements the Font interface and therefore it can handle different fonts in a workbook.
Question 12. What Is The Purpose Of Xssfhyperlink Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It implements the Hyperlink interface. It is used to set a hyperlink to the cell contents of a spreadsheet.
Question 13. What Is The Purpose Of Xssfcreationhelper Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xssf.usermodel package. It implements the CreationHelper interface. It is used as a support class for formula evaluation and setting up hyperlinks.
Question 14. What Is The Purpose Of Xssfprintsetup Class In Apache Poi?
Answer :
This is a class under the org.apache.poi.xsssf.usermodel package. It implements the PrintSetup interface. It is used to set print page size, area, options, and settings.
Question 15. Write Down Steps To Create A Spreadsheet In Apache Poi?
Answer :
The following code snippet is used to create a spreadsheet:
//Create Blank workbook
XSSFWorkbook workbook = new XSSFWorkbook();
//Create a blank spreadsheet
XSSFSheet spreadsheet = workbook.createSheet("Sheet Name");
Write down steps to create a row in a spreadsheet in Apache POI.
The following code snippet is used to create a row.
XSSFRow row = spreadsheet.createRow((short)1);
Question 16. Write Down Steps To Create A Cell In A Spreadsheet In Apache Poi?
Answer :
The following code snippet is used for creating a cell:
//create new workbook
XSSFWorkbook workbook = new XSSFWorkbook();
//create spreadsheet with a name
XSSFSheet spreadsheet = workbook.createSheet("new sheet");
//create first row on a created spreadsheet
XSSFRow row = spreadsheet.createRow(0);
//create first cell on created row
XSSFCell cell = row.createCell(0);
Question 17. How Will You Style A Cell Using Apache Poi?
Answer :
XSSFCellStyle class is used to style a cell. Following code snippet can be used to set the cell alignment to "Top Left".
XSSFCellStyle style1 = workbook.createCellStyle();
spreadsheet.setColumnWidth(0, 8000);
style1.setAlignment(XSSFCellStyle.ALIGN_LEFT);
style1.setVerticalAlignment(XSSFCellStyle.VERTICAL_TOP);
cell.setCellValue("Top Left");
cell.setCellStyle(style1);
Question 18. How Will You Add A Font To A Cell Using Apache Poi?
Answer :
XSSFFont class is used to add a font to a cell. Following code snippet can be used to set the background color of a cell to "Green".
//Create a new font and alter it.
XSSFFont font = workbook.createFont();
font.setFontHeightInPoints((short) 30);
font.setFontName("IMPACT");
font.setItalic(true);
font.setColor(HSSFColor.BRIGHT_GREEN.index);
//Set font into style
XSSFCellStyle style = workbook.createCellStyle();
style.setFont(font);
Question 19. How Will You Rotate A Cell Content Using Apache Poi?
Answer :
XSSFCellStyle class can be used to rotate a cell. Following code snippet can be used to set the cell text alignment to a specified angle.
//90 degrees
XSSFCellStyle myStyle = workbook.createCellStyle();
myStyle.setRotation((short) 90);
cell = row.createCell(5);
cell.setCellValue("90D angle");
cell.setCellStyle(myStyle);
Question 20. How Will You Add A Sum Formular To A Cell Using Apache Poi?
Answer :
XSSFCell.CELL_TYPE_FORMULA can be used to the cell as formula cell.
// Create SUM formula
cell.setCellType(XSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("SUM(C2:C3)" );
cell = row.createCell(3);
cell.setCellValue("SUM(C2:C3)");
Question 21. How Will You Add A Power Formular To A Cell Using Apache Poi?
Answer :
XSSFCell.CELL_TYPE_FORMULA can be used to the cell as formula cell.
// Create SUM formula
cell.setCellType(XSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("POWER(C2:C3)" );
cell = row.createCell(3);
cell.setCellValue("POWER(C2:C3)");
Question 22. How Will You Add A Max Formular To A Cell Using Apache Poi?
Answer :
XSSFCell.CELL_TYPE_FORMULA can be used to the cell as formula cell.
// Create SUM formula
cell.setCellType(XSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("MAX(C2:C3)" );
cell = row.createCell(3);
cell.setCellValue("MAX(C2:C3)");
Question 23. How Will You Add A Fact Formular To A Cell Using Apache Poi?
Answer :
XSSFCell.CELL_TYPE_FORMULA can be used to the cell as formula cell.
// Create SUM formula
cell.setCellType(XSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("FACT(C2)" );
cell = row.createCell(3);
cell.setCellValue("FACT(C2)");
Question 24. How Will You Add A Sqrt Formular To A Cell Using Apache Poi?
Answer :
XSSFCell.CELL_TYPE_FORMULA can be used to the cell as formula cell.
// Create SUM formula
cell.setCellType(XSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("SQRT(C2)" );
cell = row.createCell(3);
cell.setCellValue("SQRT(C2)");
Question 25. How Will You Add A Hyperlink To A Cell Using Apache Poi?
Answer :
XSSFHyperlink can be used to the add an hyperlink to a cell.
CreationHelper createHelper = workbook.getCreationHelper();
XSSFHyperlink link = (XSSFHyperlink)createHelper.createHyperlink(Hyperlink.LINK_URL);
link.setAddress("http://www.tutorialspoint.com/" );
cell.setHyperlink((XSSFHyperlink) link);
Question 26. How Will You Set The Printable Area Of An Excel Using Apache Poi?
Answer :
Following code snippet demonstrate setting up the printable area of an excel using Apache POI.
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet spreadsheet = workbook
.createSheet("Print Area");
//set print area with indexes
workbook.setPrintArea(
0, //sheet index
0, //start column
5, //end column
0, //start row
5 //end row
);
//set paper size
spreadsheet.getPrintSetup().setPaperSize(
XSSFPrintSetup.A4_PAPERSIZE);
//set display grid lines or not
spreadsheet.setDisplayGridlines(true);
//set print grid lines or not
spreadsheet.setPrintGridlines(true);
Apache POI PPT Related Practice Tests |
---|
Apache HBase Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.