Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
What Is poi-examples-5.2.3.jar?
What Is poi-examples-5.2.3.jar?
✍: FYIcenter.com
poi-examples-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which
provides an API for Microsoft document files of Word, Excel, PowerPoint, and Visio.
poi-examples-5.2.3.jar provides examples for both poi.jar and poi-ooxml.jar components.
poi-examples-5.2.3.jar is distributed as part of the poi-bin-5.2.3-20220909.zip download file.
JAR File Size and Download Location:
JAR name: poi-examples-5.2.3.jar Target JDK version: 1.6 Dependency: poi.jar poi-ooxml.jar File name: poi-examples-5.2.3.jar File size: 388829 bytes Release date: 09-09-2022 Download: Apache POI Website
Here are Java Source Code files for poi-examples-5.2.3.jar:
⏎ org/apache/poi/examples/hslf/TableDemo.java
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.examples.hslf;
import java.awt.Color;
import java.io.FileOutputStream;
import org.apache.poi.hslf.usermodel.HSLFSlide;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.hslf.usermodel.HSLFTable;
import org.apache.poi.hslf.usermodel.HSLFTableCell;
import org.apache.poi.hslf.usermodel.HSLFTextRun;
import org.apache.poi.sl.draw.DrawTableShape;
import org.apache.poi.sl.usermodel.TextParagraph.TextAlign;
import org.apache.poi.sl.usermodel.VerticalAlignment;
/**
* Demonstrates how to create tables
*/
public final class TableDemo {
//test data for the first table
static final String[][] txt1 = {
{"INPUT FILE", "NUMBER OF RECORDS"},
{"Item File", "11,559"},
{"Vendor File", "502"},
{"Purchase History File - # of PO\u2019s\r(12/01/04 - 05/31/06)", "12,852"},
{"Purchase History File - # of PO Lines\r(12/01/04 - 05/31/06)", "53,523" },
{"Total PO History Spend", "$10,172,038"}
};
//test data for the second taable
static final String[][] txt2 = {
{"Data Source"},
{"CAS Internal Metrics - Item Master Summary\r" +
"CAS Internal Metrics - Vendor Summary\r" +
"CAS Internal Metrics - PO History Summary"}
};
public static void main(String[] args) throws Exception {
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
HSLFSlide slide = ppt.createSlide();
create1stTable(slide);
create2ndTable(slide);
try (FileOutputStream out = new FileOutputStream("hslf-table.ppt")) {
ppt.write(out);
}
}
}
static void create1stTable(HSLFSlide slide) {
//six rows, two columns
HSLFTable table1 = slide.createTable(6, 2);
for (int i = 0; i < txt1.length; i++) {
for (int j = 0; j < txt1[i].length; j++) {
HSLFTableCell cell = table1.getCell(i, j);
HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0);
rt.setFontFamily("Arial");
rt.setFontSize(10d);
if(i == 0){
cell.getFill().setForegroundColor(new Color(227, 227, 227));
} else {
rt.setBold(true);
}
cell.setVerticalAlignment(VerticalAlignment.MIDDLE);
cell.setHorizontalCentered(true);
cell.setText(txt1[i][j]);
}
}
DrawTableShape dts1 = new DrawTableShape(table1);
dts1.setAllBorders(1.0, Color.black);
table1.setColumnWidth(0, 300);
table1.setColumnWidth(1, 150);
int pgWidth = slide.getSlideShow().getPageSize().width;
table1.moveTo((pgWidth - table1.getAnchor().getWidth())/2., 100.);
}
static void create2ndTable(HSLFSlide slide) {
//two rows, one column
HSLFTable table2 = slide.createTable(2, 1);
for (int i = 0; i < txt2.length; i++) {
for (int j = 0; j < txt2[i].length; j++) {
HSLFTableCell cell = table2.getCell(i, j);
HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0);
rt.setFontSize(10d);
rt.setFontFamily("Arial");
if(i == 0){
cell.getFill().setForegroundColor(new Color(0, 51, 102));
rt.setFontColor(Color.white);
rt.setBold(true);
rt.setFontSize(14d);
cell.setHorizontalCentered(true);
} else {
rt.getTextParagraph().setBullet(true);
rt.setFontSize(12d);
rt.getTextParagraph().setTextAlign(TextAlign.LEFT);
cell.setHorizontalCentered(false);
}
cell.setVerticalAlignment(VerticalAlignment.MIDDLE);
cell.setText(txt2[i][j]);
}
}
table2.setColumnWidth(0, 300);
table2.setRowHeight(0, 30);
table2.setRowHeight(1, 70);
DrawTableShape dts2 = new DrawTableShape(table2);
dts2.setOutsideBorders(Color.black, 1.0);
table2.moveTo(200, 400);
}
}
⏎ org/apache/poi/examples/hslf/TableDemo.java
Or download all of them as a single archive file:
File name: poi-examples-5.2.3-src.zip File size: 396538 bytes Release date: 2022-09-09 Download
⇒ Download and Install poi-bin-3.15-20160924.zip
⇐ What Is poi-scratchpad-5.2.3.jar?
2017-03-22, ≈34🔥, 0💬
Popular Posts:
HttpComponents Core Source Code Files are provided in the source package file, httpcomponents-core-5...
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
JAX-RPC is an API for building Web services and clients that used remote procedure calls (RPC) and X...
What Is commons-net-ftp-2.0.jar? commons-net-ftp-2.0.jar is the JAR file for Apache Commons Net FTP ...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...