We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to display dynamic data in header/footer

Thread ID:

Created:

Updated:

Platform:

Replies:

119189 May 20,2015 01:39 AM May 25,2015 06:52 AM WPF 3
loading
Tags: DocIO
Igor
Asked On May 20, 2015 01:39 AM

Hi,

In my project I am filling a word template file with some dynamic data.
As word doesn't allow to use form fields in header/footer, I used a little trick with STYLEREF to accomplish it.
Basically I have one or more hidden form fields in the body each with its own style, and in the header/footer I'm using STYLEREF in places where I need the data to be shown.
But, when filling the data with DocIO, this doesn't work, at least not automatically.

Is it possible to accomplish the same with DocIO?

Thx,
Igor

Divyalakshmi Vasudevan [Syncfusion]
Replied On May 21, 2015 05:31 AM


Hi Igor,

Thank you for using Syncfusion products.

In DocIO, text form field has been preserved with the following structure.

WTextFormField

|
FieldMarkSeparator -
|
FieldResult
|
FieldEnd

Essential DocIO internally adds FieldSeparator, FieldResult and FieldEnd while adding the TextFormField item to the paragraph. If you need to hide the TextFormField, then you need to set the hidden property as true for all the elements. So that you can able to hide the StyleRef field result also. We have prepared a sample to illustrate the same. Please find the sample from the below link


Sample Link:
http://www.syncfusion.com/downloads/support/forum/119189/GenerateWord_WPF-988345401.zip
In the input template document, we have inserted the StyleRef field with Heading1 style in header which refer the PersonName TextFormField with same Style in the body, fill the form field data and set the hidden property as true.


Please let us know in case of any other questions.

Regards,
Divyalakshmi V


Igor
Replied On May 22, 2015 05:38 AM

Hi Divyalakshm,

Thanks for your info and a sample, but it seems to me my question wasn't clear enough, sorry.
I have no problem with hiding form fields, my problem is that the data from the form fields isn't copied in their STYLEREF places in the footer.
What I am doing is:
1) Open a word template file
2) Fill the needed data in form fields and tables
3) Save the word file  (.doc)
4) Print the resulting file (using WordDocument.RenderAsImage)
6) Convert the file to PDF
7) Send the PDF to the customer

The problem is that my STYLEREF fields in the footer don't show any values ie. the values are not copied from the form fields with the same style.
On the print as well as in the PDF, there is no info which should be in the footer.
Is there something I need to do before saving the file, to apply the STYLEREFs?

Regards,
Igor

Sathish K [Syncfusion]
Replied On May 25, 2015 06:52 AM

Hi Igor,

Thank you for your update.

Currently DocIO doesn’t provide support for StyleRef field in Word document to Pdf and Image conversions. We have already logged this a feature request in our database. A support incident to track the status of this feature has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Best,
Sathish




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;