YouTube Icon

Interview Questions.

Top 100+ Apache Poi Ppt Interview Questions And Answers - May 26, 2020

fluid

Top 100+ Apache Poi Ppt Interview Questions And Answers

Question 1. What Is Apache Poi?

Answer :

Apache POI is a popular API that allows programmers to create, adjust, and display MS Office files the use of Java packages. It is an open supply library evolved and dispensed by way of Apache Software Foundation to design or alter Microsoft Office files the use of Java application. It contains lessons and methods to decode the person input statistics or a record into MS Office files.

Question 2. Name Some Of The Components Of Apache Poi?

Answer :

Components of Apache POI:

Apache POI includes lessons and techniques to work on all OLE2 Compound files of MS Office. The listing of components of this API is given underneath.

POIFS (Poor Obfuscation Implementation File System) − This component is the primary thing of all different POI elements. It is used to study different documents explicitly.

HSSF (Horrible Spreadsheet Format): It is used to read and write xls layout of MS-Excel files.
XSSF (XML Spreadsheet Format): It is used for xlsx record format of MS-Excel.
HPSF (Horrible Property Set Format): It is used to extract belongings sets of the MS-Office files.
HWPF (Horrible Word Processor Format): It is used to examine and write document extension documents of MS-Word.
XWPF (XML Word Processor Format): It is used to read and write docx extension files of MS-Word.
HSLF (Horrible Slide Layout Format): It is used for study, create, and edit PowerPoint presentations.
HDGF (Horrible DiaGram Format): It contains instructions and techniques for MS-Visio binary files.
HPBF (Horrible PuBlisher Format): It is used to study and write MS-Publisher documents.
Apache Tapestry Interview Questions
Question 3. What Is The Purpose Of Hssfworkbook Class In Apache Poi?

Answer :

It is a high-degree class below the org.Apache.Poi.Hssf.Usermodel package deal. 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 category this is used to represent both excessive and coffee level Excel report codecs. It belongs to the org.Apache.Xssf.Usemodel package deal and implements the Workbook interface.

Apache Tapestry Tutorial
Question five. What Is The Purpose Of Hssfsheet Class In Apache Poi?

Answer :

This is a category beneath the org.Apache.Poi.Hssf.Usermodel package deal. It can create excel spreadsheets and it lets in to format the sheet style and sheet information.

Apache Cassandra Interview Questions
Question 6. What Is The Purpose Of Xssfsheet Class In Apache Poi?

Answer :

This is a category which represents high stage representation of excel spreadsheet. It is under org.Apache.Poi.Hssf.Usermodel package deal.

Question 7. What Is The Purpose Of Xssfrow Class In Apache Poi?

Answer :

This is a category beneath the org.Apache.Poi.Xssf.Usermodel package. It implements the Row interface, consequently it can create rows in a spreadsheet.

Apache Cassandra Tutorial Apache Spark Interview Questions
Question 8. What Is The Purpose Of Xssfcell Class In Apache Poi?

Answer :

This is a class below the org.Apache.Poi.Xssf.Usermodel bundle. It implements the Cell interface. It is a excessive-degree illustration of cells within the rows of a spreadsheet.

Question 9. What Is The Purpose Of Xssfcellstyle Class In Apache Poi?

Answer :

This is a class beneath the org.Apache.Poi.Xssf.Usermodel package. It will provide feasible records regarding the layout of the content material in a mobile of a spreadsheet. It additionally gives options for editing that layout. It implements the CellStyle interface.

Apache Solr Interview Questions
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 deal. It offers different colorings as nested training. Usually these nested classes are represented with the aid of the usage of their personal indexes. It implements the Color interface.

Apache Solr Tutorial
Question eleven. What Is The Purpose Of Xssffont Class In Apache Poi?

Answer :

This is a category beneath the org.Apache.Poi.Xssf.Usermodel package deal. It implements the Font interface and therefore it may deal with distinct fonts in a workbook.

Apache Storm Interview Questions
Question 12. What Is The Purpose Of Xssfhyperlink Class In Apache Poi?

Answer :

This is a category under the org.Apache.Poi.Xssf.Usermodel package deal. It implements the Hyperlink interface. It is used to set a hyperlink to the mobile contents of a spreadsheet.

Apache Tapestry Interview Questions
Question thirteen. What Is The Purpose Of Xssfcreationhelper Class In Apache Poi?

Answer :

This is a class under the org.Apache.Poi.Xssf.Usermodel bundle. It implements the CreationHelper interface. It is used as a assist elegance for formulation evaluation and putting in place hyperlinks.

Apache Storm Tutorial
Question 14. What Is The Purpose Of Xssfprintsetup Class In Apache Poi?

Answer :

This is a category beneath the org.Apache.Poi.Xsssf.Usermodel package. It implements the PrintSetup interface. It is used to set print page length, place, alternatives, 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((quick)1);

Apache Hive Interview Questions
Question 16. Write Down Steps To Create A Cell In A Spreadsheet In Apache Poi?

Answer :

The following code snippet is used for growing a mobile:

//create new workbook

XSSFWorkbook workbook = new XSSFWorkbook();

//create spreadsheet with a call

XSSFSheet spreadsheet = workbook.CreateSheet("new sheet");

//create first row on a created spreadsheet

XSSFRow row = spreadsheet.CreateRow(zero);

//create first cell on created row

XSSFCell cellular = row.CreateCell(0);

Apache Hive Tutorial
Question 17. How Will You Style A Cell Using Apache Poi?

Answer :

XSSFCellStyle class is used to fashion a mobile. Following code snippet can be used to set the mobile alignment to "Top Left".

XSSFCellStyle style1 = workbook.CreateCellStyle();

spreadsheet.SetColumnWidth(zero, 8000);

style1.SetAlignment(XSSFCellStyle.ALIGN_LEFT);

style1.SetVerticalAlignment(XSSFCellStyle.VERTICAL_TOP);

cellular.SetCellValue("Top Left");

cell.SetCellStyle(style1);

Apache Pig Interview Questions
Question 18. How Will You Add A Font To A Cell Using Apache Poi?

Answer :

XSSFFont elegance is used to feature a font to a cellular. Following code snippet can be used to set the history coloration of a mobile to "Green".

//Create a new font and regulate it.

XSSFFont font = workbook.CreateFont();

font.SetFontHeightInPoints((brief) 30);

font.SetFontName("IMPACT");

font.SetItalic(proper);

font.SetColor(HSSFColor.BRIGHT_GREEN.Index);

//Set font into fashion

XSSFCellStyle style = workbook.CreateCellStyle();

style.SetFont(font);

Apache Cassandra Interview Questions
Question 19. How Will You Rotate A Cell Content Using Apache Poi?

Answer :

XSSFCellStyle elegance may be used to rotate a cell. Following code snippet may be used to set the cell text alignment to a particular angle.

//ninety degrees

XSSFCellStyle myStyle = workbook.CreateCellStyle();

myStyle.SetRotation((quick) ninety);

mobile = row.CreateCell(five);

mobile.SetCellValue("90D attitude");

mobile.SetCellStyle(myStyle);

Apache Pig Tutorial
Question 20. How Will You Add A Sum Formular To A Cell Using Apache Poi?

Answer :

XSSFCell.CELL_TYPE_FORMULA may be used to the cellular as formula cell.

// Create SUM method

cell.SetCellType(XSSFCell.CELL_TYPE_FORMULA);

cellular.SetCellFormula("SUM(C2:C3)" );

cell = row.CreateCell(three);

cellular.SetCellValue("SUM(C2:C3)");

Apache Flume Interview Questions
Question 21. How Will You Add A Power Formular To A Cell Using Apache Poi?

Answer :

XSSFCell.CELL_TYPE_FORMULA may be used to the mobile as components cellular.

// Create SUM formula

mobile.SetCellType(XSSFCell.CELL_TYPE_FORMULA);

cellular.SetCellFormula("POWER(C2:C3)" );

cellular = 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 system cellular.

// Create SUM method

cellular.SetCellType(XSSFCell.CELL_TYPE_FORMULA);

cell.SetCellFormula("MAX(C2:C3)" );

cell = row.CreateCell(3);

mobile.SetCellValue("MAX(C2:C3)");

Apache Flume Tutorial
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 cellular as formula cellular.

// Create SUM formulation

cellular.SetCellType(XSSFCell.CELL_TYPE_FORMULA);

mobile.SetCellFormula("FACT(C2)" );

cellular = row.CreateCell(3);

mobile.SetCellValue("FACT(C2)");

Apache Kafka Interview Questions
Question 24. How Will You Add A Sqrt Formular To A Cell Using Apache Poi?

Answer :

XSSFCell.CELL_TYPE_FORMULA may be used to the cellular as formulation cell.

// Create SUM system

mobile.SetCellType(XSSFCell.CELL_TYPE_FORMULA);

mobile.SetCellFormula("SQRT(C2)" );

cell = row.CreateCell(3);

mobile.SetCellValue("SQRT(C2)");

Apache Spark Interview Questions
Question 25. How Will You Add A Hyperlink To A Cell Using Apache Poi?

Answer :

XSSFHyperlink may be used to the upload an hyperlink to a mobile.

CreationHelper createHelper = workbook.GetCreationHelper();

XSSFHyperlink link = (XSSFHyperlink)createHelper.CreateHyperlink(Hyperlink.LINK_URL);

link.SetAddress("http://www.Tutorialspoint.Com/" );

cellular.SetHyperlink((XSSFHyperlink) link);

Apache Kafka Tutorial
Question 26. How Will You Set The Printable Area Of An Excel Using Apache Poi?

Answer :

Following code snippet demonstrate setting up the printable vicinity of an excel the usage of Apache POI.

XSSFWorkbook workbook = new XSSFWorkbook(); 

XSSFSheet spreadsheet = workbook

.CreateSheet("Print Area");

//set print region with indexes

workbook.SetPrintArea(

   zero, //sheet index

   zero, //start column

   5, //give up column

   0, //begin row

   5 //stop row

);

//set paper length

spreadsheet.GetPrintSetup().SetPaperSize(

XSSFPrintSetup.A4_PAPERSIZE);

//set show grid strains or not

spreadsheet.SetDisplayGridlines(actual);

//set print grid strains or now not

spreadsheet.SetPrintGridlines(true);

Apache Ant Interview Questions




CFG