Hello, I'm trying to build a poi-based solution in order to create a manager
able to generate ppt files from a template. The idea is to pass as parameter a
template with placeholders, and I would like to fill the placeholders with the
data obtained from the DB.
I'm making some tests and I'm not sure how to get any placeholder from the
original template because I really won't know the type of the placeholder.
I'm using a very basic template file (attached) and here is the code of the
test, as u will see I'm trying different ways at the same time:
public void testPlaceHolders(){
try {
SlideShow ppt = new SlideShow(new
FileInputStream(PATH_PPT
+ "plantillaPlaceHolders.pot"));
TextShape ph = ppt.getSlides()[0]
.getPlaceholder(
OEPlaceholderAtom.Body);
assertNotNull("El placeholder es null", ph);
TextRun tr = ph.createTextRun();
tr.setText("el texto ...");
tr.setRawText("raw text");
ph.setText("El texto del enlace");
escribirFichero(ppt, "presentacionPlaceholder.ppt");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
I have three specifics questions:
- Is there any way to get the placeholders from some kind of array without
knowing (or guessing) the type??
- What would be the type of the tow placeholders in the file attatched?
- How can I add information to them??
Thanks in advance for the help.
José Piersanti.
DISCLAIMER:
La información contenida en este mensaje puede ser de uso interno o
confidencial. Si al revisarla usted entiende que no es el destinatario, no
puede copiar o distribuir el mensaje a nadie, debe destruirlo y notificar tal
hecho al emisor. Las opiniones o cualquier otra información contenida, no
relacionada con el negocio del Grupo Caja Madrid no debe considerarse como
emitida ni aprobada por el mismo.
This information is intended to be confidential and for the exclusive use of
the individual or entity named above only . If you are not the intended
recipient, be aware that retention, dissemination, distribution or copying of
this message is strictly prohibited. If you received it by mistake, please
notify the sender immediately and return it to the address above. The opinions
and views expressed and any other information contained in this message which
are not directly related to the businesses of Caja Madrid Group are not to be
considered as disclosed, shared nor approved by it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]