sitimoen / xdocreport

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

@FieldMetada No Effect #293

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I use this sample with my 
object:http://code.google.com/p/xdocreport/wiki/FieldsMetadataTemplate
bug I don't find @FieldMetadata but find @FieldMetada

What is the expected output? What do you see instead?
Docx has no any change

What version of the product are you using? On what operating system?
I tried with 1.0.2/1.0.0

Please provide any additional information below.
original code:
context.put("data", dataObject);

I tried this
    FieldsMetadata metadata = report.createFieldsMetadata();
    metadata.addFieldAsTextStyling("data.comments", SyntaxKind.Html);
still no effect
Please tell me how to use metadata.addFieldAsTextStyling or use @FieldMetada 
for my wants
Thanks!!

Original issue reported on code.google.com by dt0...@gmail.com on 5 Sep 2013 at 9:44

GoogleCodeExporter commented 8 years ago
Do you use mergefield to set "data.comments" in your docx? If yes, please 
attach a simple Java main + docx.

Original comment by angelo.z...@gmail.com on 5 Sep 2013 at 9:48

GoogleCodeExporter commented 8 years ago
Attach is my demo sample
please tell me what mistake I make
Thank you!!

Original comment by dt0...@gmail.com on 5 Sep 2013 at 10:26

Attachments:

GoogleCodeExporter commented 8 years ago
At first you are right, the name of the annotation is @FieldMetada, we will fix 
that in the 1.0.3 to rename with @FieldMetadata.

I have tried your demo (just clean the classpath with well version of 
XDocReport) and it works? In my case "Bold Text" is bolded.

But I would like tell you that you use "$data.comments", and it is better to 
use "$data.Comments". I suggest you to use this annotation.

If you wish to use @FieldMetada, you must : 

1) rename your field with "$data.Comments"
2) use FieldsMetadata#load method in order to XDocReport interpret the 
@FieldMetada like this : 

---------------------------------------------------
// 1) Create FieldsMetadata
FieldsMetadata fieldsMetadata = report.createFieldsMetadata();

// 2) Load fields metadata from Java Class
fieldsMetadata.load("data", ANote.class);
---------------------------------------------------

But pay attention, 1.0.3 will change the name of the annotation.

Original comment by angelo.z...@gmail.com on 5 Sep 2013 at 1:20

GoogleCodeExporter commented 8 years ago
I follow your suggestion, but the result still fail.
Attach is my docx of result.

What is the well version of XDocReport?
My classpath's jar can works right?

Original comment by dt0...@gmail.com on 6 Sep 2013 at 1:58

Attachments:

GoogleCodeExporter commented 8 years ago
1.0.2 is the current release. I have attached my project which works well. You 
have 2 Java main : 

 * XDocDemo_WithAnnotation : uses the @FieldMetadata + FieldsMetadata#load
 * XDocDemo_WithoutAnnotation : uses FieldsMetadata#addFieldAsTextStyling

Regards Angelo

Original comment by angelo.z...@gmail.com on 6 Sep 2013 at 7:20

Attachments:

GoogleCodeExporter commented 8 years ago
It's ok!
But still has bug.
I want the bookmark font 14pt and red, the fonts after the html tag are changed 
style to original.
How to keep the style and use the html tag.
Thank you!!

Original comment by dt0...@gmail.com on 9 Sep 2013 at 8:05

Attachments:

GoogleCodeExporter commented 8 years ago
>How to keep the style and use the html tag.

I think it's the same problem than 
https://code.google.com/p/xdocreport/issues/detail?id=290 

Keeping original style is not managed. I think it's hard to do that and today I 
have no time to investigate for that.

Regards Angelo

Original comment by angelo.z...@gmail.com on 9 Sep 2013 at 8:09

GoogleCodeExporter commented 8 years ago
I close this issue because original problem was about @FieldsMetadata which is 
resolved.

Original comment by angelo.z...@gmail.com on 18 Feb 2014 at 2:43