MohamedSaeed / xdocreport

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

Docm instead if Docx ? #308

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I am trying to implement macro in my docx template, but for that i need to save 
to file as .docm, i tied by save my current template which work fine in .docm 
format, but while changing the fields i got the following exception:

24703 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default 
(self-tuning)'] DEBUG freemarker.cache  - Could not find template in cache, 
creating new one; id=[
"fr.opensagres.xdocreport.document.docx.DocxReport@1308a29!word/document.xml"["e
n_US",UTF-8,parsed] ]
24703 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default 
(self-tuning)'] DEBUG freemarker.cache  - Compiling FreeMarker template 
"fr.opensagres.xdocreport.
document.docx.DocxReport@1308a29!word/document.xml"["en_US",UTF-8,parsed]  from 
"fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@839e9a"
freemarker.core.ParseException: Token manager error: 
freemarker.core.TokenMgrError: Lexical error at line 3, column 106682.  
Encountered: "T" (84), after : "\"file:///D:
\\" in 
fr.opensagres.xdocreport.document.docx.DocxReport@1308a29!word/document.xml
        at freemarker.template.Template.<init>(Template.java:174)
        at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
        at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
        at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
        at freemarker.template.Configuration.getTemplate(Configuration.java:578)
        at freemarker.template.Configuration.getTemplate(Configuration.java:543)

This exception is throw 

OutputStream out = new FileOutputStream(temp);
        Options options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.XWPF);
        options.subOptions(PdfOptions.create().fontEncoding("windows-1250"));
        xdocReport.convert(context, options, out); // Here it throw the exception

Is it possible to use .docm?

Regards,
Bilel

Original issue reported on code.google.com by oueslatibilel216@gmail.com on 27 Sep 2013 at 5:50

GoogleCodeExporter commented 9 years ago
Sorry i made a mistake,

-----------------------------------

I am trying to implement macro in my docx template, but for that i need to save 
to file as .docm, i tried by save my current template which work fine in .docx 
format, but while changing the fields i got the following exception:
--------------------------------------

Thanks,
Bilel

Original comment by oueslatibilel216@gmail.com on 27 Sep 2013 at 6:34

GoogleCodeExporter commented 9 years ago
Hi Bilel,

It's hard to help you just with your information. Please attach docx which 
works and which crashes with Java main + Pojo.

Regards Angelo

Original comment by angelo.z...@gmail.com on 27 Sep 2013 at 7:30

GoogleCodeExporter commented 9 years ago
Hi Angelo,.

After using another Template docm , as smaller one it working fine, i just 
needed to know if docm is supported or not.
for the template I will try to find out the issue.

Thank u again,
Bilel

Original comment by oueslatibilel216@gmail.com on 27 Sep 2013 at 10:24

GoogleCodeExporter commented 9 years ago
Ok I close this issue.

Original comment by angelo.z...@gmail.com on 27 Sep 2013 at 11:24