You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by prathapreddypolu <pr...@gmail.com> on 2012/07/03 06:42:15 UTC

word document update filed functionality implement in POI word document generation

HI , 

I generate document output file . after generating output file ,I need to
update table content dynamically. 
see the below.Please can you help somebody . How i need to update table
content dynamically 

http://apache-poi.1045710.n5.nabble.com/file/n5710363/TableContent.png 

example :


      Table of Contents
1.	Statistics Items	6(page number)
1.1	Resource Management	6(page number)
1.1.1	Resource (40)	6(page number)
1.2	BSC Measurement Function	9(page number)
1.2.1	Channel Resource (406)	  9(page number)
1.3	Call Summary Log	 12(page number)
1.3.1	CSL Statistics (463)	12(page number)


--
View this message in context: http://apache-poi.1045710.n5.nabble.com/word-document-update-filed-functionality-implement-in-POI-word-document-generation-tp5710363.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: word document update filed functionality implement in POI word document generation

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
It is highly likely that I am incorrect, but I very much doubt that this is
possible using POI; I have been following a couple of discussions relating
to Microsoft's own OOXML SDK and even it has problems with this operation.
To be able to determine where each section falls - i.e. it's page number -
the document needs to be formatted into pages and this is something that is
only done when the file is rendered. Thinking about it further, even when
using Word itself, you need to explicitly tell the application to update the
TOC - press F9 for instance - so even Word does not update the TOC
automatically, as the document is being generated. My suggestion would be to
base all of your documents on a template that includes a VBA macro which
will run when the document is opened; this macro should include code to
update the TOC. The one obvious problem with this is that the user can
choose to disable macros and your standards may prohibit including trusted
macros into documents to circumvent this problem.

Yours

Mark B

PS. I have heard that the TOC will be updated when the document is prepared
for printing but do not know if this will help in any way.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/word-document-update-filed-functionality-implement-in-POI-word-document-generation-tp5710363p5710364.html
Sent from the POI - User mailing list archive at Nabble.com.

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