Thanks Andreas. 

I got to do what I need yesterday, looking here: 


https://stackoverflow.com/questions/21156461/get-inputstream-forom-apaches-poi-workbook/21157326
 


https://stackoverflow.com/questions/34154003/taking-long-time-to-generate-excel-file-using-poi
 


https://stackoverflow.com/questions/30026819/write-excel-sheet-using-apache-poi 



Atenciosamente, Luiz Antonio Falaguasta Barbosa 
Embrapa Informática Agropecuária (CNPTIA) 
Embrapa Brasil eira de P e squisa Agropecu ária ( Embrapa) 
Campinas - SP 

[email protected] 
http://lattes.cnpq.br/5524528660042920 
Fone: +55 (19) 3211-5843 
https://www.embrapa.br/informatica-agropecuaria www.embrapa.br | fb.com/embrapa 
| twitter.com/embrapa 


----- Original Message -----

From: "Andreas Beeker" <[email protected]> 
To: [email protected] 
Sent: Friday, March 8, 2019 1:44:23 PM 
Subject: Re: Writing content in ttf code128 

Hi, 

just to recap: 
a) you want to email a .docx file to your clients 
b) this .docx file contains a .xlsx file as an embedded document 
c) this .xlsx contains cells with barcodes formatted via a code128 font 

Regarding c): 
My guess is you need to set the barcode string as text value of a cell and set 
the style for the barcode font. 
check http://poi.apache.org/components/spreadsheet/quick-guide.html for the 
basics. 

Regarding b) 
I haven't found a tutorial on how to embed other office documents on a quick 
view, but this is definitely possible. Usually I re-engineer a sample document 
by unzipping it and checking the contents of the various files. 
It helps if you compare the contents before and after you've added the .xlsx. 
POI gives you access to the various files either via low-level OPC API (see 
org.apache.poi.openxml4j.opc.OPCPackage) or via some high-level document based 
API (see http://poi.apache.org/components/document/quick-guide-xwpf.html) 

Regarding a) 
Out-of-focus for here - but Apache Commons Email is your friend 

So regarding your questions: 
1) yes 
2) how would a .csv contain information about a font? (rhetorical question) 
... so you need either .xls or .xlsx or some other style-able format 
3) if you intend to call XSSFSheet.autoSizeColumn then yes, otherwise no 

a bit off-topic: if embedding the .xlsx is too much hassle, I would simply add 
an additional email attachment containing the .xlsx ... 

Andi 




On 06.03.19 18:14, Luiz Antonio Falaguasta Barbosa - CNPTIA wrote: 
> I need to create a spreadsheet and write one of its columns in ttf code128. 
> This spreadsheet (with data from DBMS) will be used in a direct mail, into 
> Word, to generate tags based on data from the spreadsheet. 
> 
> 
> 1. Can I use POI to do that? 
> 
> 
> 2. Do I need to create the spreadsheet as a .xls file or can I create a .csv 
> file? 
> 
> 
> 3. Do I need to install ttf code128 in the webserver where I will have Java 
> code that create the spreadsheet with data from DBMS? 
> 
> 
> 




____________________________________________________________________________
Aviso de confidencialidade

Esta mensagem da Empresa  Brasileira de Pesquisa  Agropecuaria (Embrapa), 
empresa publica federal  regida pelo disposto  na Lei Federal no. 5.851,  de 7 
de dezembro de 1972,  e  enviada exclusivamente  a seu destinatario e pode 
conter informacoes  confidenciais, protegidas  por sigilo profissional.  Sua 
utilizacao desautorizada  e ilegal e  sujeita o infrator as penas da lei. Se 
voce  a recebeu indevidamente, queira, por gentileza, reenvia-la ao emitente, 
esclarecendo o equivoco.

Confidentiality note

This message from Empresa  Brasileira de Pesquisa  Agropecuaria (Embrapa), a 
government company  established under  Brazilian law (5.851/72), is directed 
exclusively to  its addressee  and may contain confidential data,  protected 
under  professional secrecy  rules. Its unauthorized  use is illegal and  may 
subject the transgressor to the law's penalties. If you are not the addressee, 
please send it back, elucidating the failure.

Reply via email to