How to create page borders using Apache POI in excel files with Java

0 votes

In my application, I've been using Apache POI to generate excel invoices and reports. The report uses several font sizes, bordered and non-bordered cells, varied foreground and background colours, and numerous cell layouts. Page borders are a new requirement that I must include. I have examined the majority of the samples. I was unable to locate sample code for the entire page; only for cell-level boundaries.

In OpenOffice/Libre Office excel applications this can be achieved by going to Format>Page>Border and selecting options as in the image below

page border

Can someone please help me with this?

Dec 12, 2022 in Others by Kithuzzz
• 28,900 points
93 views

1 answer to this question.

0 votes

Microsoft Excel cannot do this. Libreoffice Calc and Openoffice Calc can. But if you save in Calc as *.xlsx format, then the page border lines will not be saved. So there is no place in *.xlsx for saving page borderlines. Saved as *.ods the page border lines will be saved, but apache-poi is not supposed to deal with *.ods files. 

answered Dec 13, 2022 by narikkadan
• 53,520 points

Related Questions In Others

0 votes
0 answers

Data Driven Framework -- how to read and write in excel sheet using Selenium WebDriver with java

I'm using this code to read something, ...READ MORE

Oct 31, 2022 in Others by Kithuzzz
• 28,900 points
116 views
0 votes
1 answer

How to create a drop-down in excel with custom values

You can accomplish that using code rather ...READ MORE

answered Sep 25, 2022 in Others by narikkadan
• 53,520 points
150 views
0 votes
1 answer

How to create Dropdown list in excel using php

Try this: $objValidation = $objPHPExcel->getActiveSheet()->getCell('B'.$i)->getDataValidation(); $objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST ); $objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 53,520 points
314 views
0 votes
1 answer

How to create a dependent drop down list using [Apache POI]

There is nothing apache poi cannot do, ...READ MORE

answered Oct 24, 2022 in Others by narikkadan
• 53,520 points
827 views
0 votes
1 answer
0 votes
1 answer

What is the better API to Reading Excel sheets in java - JXL or Apache POI

Here are the things where both APIs ...READ MORE

answered Oct 9, 2022 in Others by narikkadan
• 53,520 points
597 views
0 votes
1 answer

Apache POI. Setup data filters in Excel

It's already enabled in Apache POI 3.7. ...READ MORE

answered Oct 21, 2022 in Others by narikkadan
• 53,520 points
315 views
0 votes
1 answer

How to get columns from Excel files using Apache POI?

The only way to see all the ...READ MORE

answered Oct 18, 2022 in Others by narikkadan
• 53,520 points
1,047 views
0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 53,520 points
242 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP