StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

retrieving template information #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is it possible to include the current page number to a mergefield and then use 
it in a function (the aim is to be sure that the final document does not exceed 
a number of page).

I tried several way to do it, but I always finish with : 
org.apache.velocity.exception.ParseErrorException: Encountered "(" at 
fr.opensagres.xdocreport.document.docx.DocXReport@1284f8e!word/document.xml[line
 1, column 2024]
Was expecting one of:
    <RPAREN> ...
    <WHITESPACE> ...
    "-" ...
    "+" ...
    "*" ...
    "/" ...
    "%" ...
    <LOGICAL_AND> ...
    <LOGICAL_OR> ...
    <LOGICAL_LT> ...
    <LOGICAL_LE> ...
    <LOGICAL_GT> ...
    <LOGICAL_GE> ...
    <LOGICAL_EQUALS> ...
    <LOGICAL_NOT_EQUALS> ...

Original issue reported on code.google.com by hadjia...@gmail.com on 20 Oct 2011 at 7:45

GoogleCodeExporter commented 8 years ago
Hi hadija,

I don't underestand what you wish to do? Could you attach some document to 
explain us what is your need.

Thank a lot.

Regards Angelo

Original comment by angelo.z...@gmail.com on 20 Oct 2011 at 7:52

GoogleCodeExporter commented 8 years ago
Thanks for you quick response.
Actually, what I wanna do is to be sure that the final document is at maximum 1 
page long otherwise, I would like to send a warning to the user. 

The only way I thought to do it is to check the page number and put it as an 
function argument.

Here's a file with what I tried

Thanks a lot.

Original comment by hadjia...@gmail.com on 20 Oct 2011 at 8:05

Attachments:

GoogleCodeExporter commented 8 years ago
When you write #set ($page= PAGE)
PAGE is value from the Java context? You do context.put("PAGE", 1);
Is that?
It seems that you wish count the page number but I think it's not possible to 
do that. If you wish know the page number, POI could help you?

Regards Angelo

Original comment by angelo.z...@gmail.com on 20 Oct 2011 at 8:33

GoogleCodeExporter commented 8 years ago
Actually, PAGE is the code used by Word in the xml file to set the page number. 
This is not any variable I tried to set.

I'm going to see what POI can do for that.

Thank you for your time.

regarde Idir

Original comment by hadjia...@gmail.com on 20 Oct 2011 at 8:38

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 1 Nov 2011 at 3:52