How to generate word document with apache poi
Today we will continue the topic of generating office documents from the template. To generate a docx document, we use the apache poi library.
Read Morelearn to code by examples
Today we will continue the topic of generating office documents from the template. To generate a docx document, we use the apache poi library.
Read MoreWhat most annoying programmers besides reading someone else’s code? That’s right, formatting! In a large team it is difficult to impart to everyone the same requirements for the style of …
Read MoreSuppose you write a project that must have mandatory support for java 1.6 and higher, but you only have java 9 installed and also want the compiled classes to be …
Read MoreLet’s take a simple example. It’s easier, probably, and can not be – create a list of numbers and display it on the screen through the simplest cycle:
1 2 3 4 5 |
List <Integer> numbers = Arrays.asList (1, 2, 3, 4, 5, 6); for (int number: numbers) { System.out.println (number); } |
Very often, when working on projects, you need to get the version of the pom.xml application from the command line. Here’s how you can do it:
Read MoreToday we will discuss working with pom.xml. Suppose you have a web application and you want to print its current version in some part of the page. Of course, you …
Read MoreIn today’s article, we’ll look at generating a document based on the docx document template. This is a very common task in business applications where you service needs to provide …
Read MoreLet’s look at an example of output to template a single value with information. We can take an example from previous article and modify it a little.
Read MoreUsing String.join method (from java 8)
1 2 |
String[] array = new String[] { "a", "b", "c" }; String joined2 = String.join(",", array); |
Using simple for-loop expression
1 2 3 4 5 6 |
StringBuilder sb = new StringBuilder(); for (String n : name) { if (sb.length() > 0) sb.append(','); sb.append("'").append(n).append("'"); } return sb.toString(); |
Read More