You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Fabio Alves de Araujo Ebner - Dna <fa...@dnasolution.com.br> on 2008/07/14 16:53:28 UTC

help new doc file

        


Help.. how i create a single HWPF file??


i need to create one doc with a table inside.. but i dont find anything to help me..


can some one?

please

Re: help new doc file

Posted by Rainer Schwarze <rs...@admadic.de>.
Fabio Alves de Araujo Ebner - Dna wrote:
> my rows and columns is vary .. i need to create one label's print.. my 
> user will select how many rows and column he wants to print.. and i need 
> to create one(or more) label in each line from my table to print

Inserting columns into Word tables is a rather complex thing which is 
not supported by POI-HWPF. (One needs to adjust the properties of the 
table and its columns and currently there is no interface for that 
except going for the low level data structures.)

I'm not really sure, whether this is useful: If you have a limited set 
of different column numbers - maybe 1..20, you could create a document 
which includes 20 separate tables having 1, 2, 3, ..., 20 columns. When 
you need to deliver 15 columns, keep that table and remove all the others.

It may be possible to duplicate rows by inserting the "paragraphs" which 
represent the table in order to make - say - 10 rows out of the single 
template row. However, this may require some adjustment of the HWPF code.

A quick hack may be this: If you have a maximum row count, insert all 
those tables for different column counts with the maximum rows. Then to 
deliver for instance a 15 col x 10 row table: remove all except the 15 
col table, fill the 10 rows, remove the rest of the rows.

Best wishes, Rainer
-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: help new doc file

Posted by Fabio Alves de Araujo Ebner - Dna <fa...@dnasolution.com.br>.
my rows and columns is vary .. i need to create one label's print.. my user 
will select how many rows and column he wants to print.. and i need to 
create one(or more) label in each line from my table to print
----- Original Message ----- 
From: "Rainer Schwarze" <rs...@admadic.de>
To: "POI Developers List" <de...@poi.apache.org>
Sent: Monday, July 14, 2008 4:34 PM
Subject: Re: help new doc file


> Fabio Alves de Araujo Ebner - Dna wrote:
>> Help.. how i create a single HWPF file??
>> i need to create one doc with a table inside.. but i dont find anything 
>> to help me..
>> can some one?
>> please
>
> Hi,
>
> you can't create a document from scratch in POI. You need to use an 
> existing Word document and use it as a "template". (Open it, change it, 
> then save it to a different name)
>
> Is your table fixed in number of rows and columns or do these vary?
>
> Best wishes,
> Rainer
> -- 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: help new doc file

Posted by Rainer Schwarze <rs...@admadic.de>.
Fabio Alves de Araujo Ebner - Dna wrote:
> Help.. how i create a single HWPF file??
> i need to create one doc with a table inside.. but i dont find anything to help me..
> can some one?
> please

Hi,

you can't create a document from scratch in POI. You need to use an 
existing Word document and use it as a "template". (Open it, change it, 
then save it to a different name)

Is your table fixed in number of rows and columns or do these vary?

Best wishes,
Rainer
-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org