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.

Doc not appearing correctly

Thread ID:

Created:

Updated:

Platform:

Replies:

45973 Jul 3,2006 06:51 AM Jul 3,2006 01:42 PM ASP.NET Web Forms (Classic) 2
loading
Tags: DocIO
David Rhodes
Asked On July 3, 2006 06:51 AM

Hi, I am loading a Word Document from the database into DocIO and it is not appearing as it should, eg I get footers placed at random places in the document and page 1 and 2 swapping around. Unfortunately, I cannot send you the document as it is confidential but from my point of view it looks very simple, no images or tables, just text. Here is the code I use Template template = Template.Load(templateId); WordDocument document = new WordDocument(); document.Open(new MemoryStream(template.Content, 0, template.ContentLength), FormatType.Doc); // Start Replace document.Replace("$MembershipId$", membershipId, true, true); document.Replace("$Date$", DateTime.Now.ToLongDateString(), true, true); document.Replace("$Address$", address.ToString(), true, true); document.Replace("$SubscriptionGrade$", member.SubscriptionGrade, true, true); document.Replace("$RenewalDate$", member.RenewalDate, true, true); document.Replace("$Name$", member.Title + " " + member.Surname, true, true); // End Replace document.Save("Template.doc", FormatType.Doc, context.Response, HttpContentDisposition.InBrowser);

Administrator [Syncfusion]
Replied On July 3, 2006 09:16 AM

The document.Replace() function also doesn''t work for all text

Administrator [Syncfusion]
Replied On July 3, 2006 01:42 PM

Hi David, Thanks for your interest with Essential DocIO. I have tried to load the template document from database and then I will do find and replace with the document contents including footer text. It seems working fine for me. Here is a sample for your reference. Sample : FR_FromDBDoc.zip Please let me know if it resolves your problem. If not could you send me your template document. I will try to reproduce the issue. Thanks, Prabhu. >Hi, > >I am loading a Word Document from the database into DocIO and it is not appearing as it should, eg I get footers placed at random places in the document and page 1 and 2 swapping around. > >Unfortunately, I cannot send you the document as it is confidential but from my point of view it looks very simple, no images or tables, just text. > >Here is the code I use > >Template template = Template.Load(templateId); > >WordDocument document = new WordDocument(); >document.Open(new MemoryStream(template.Content, 0, template.ContentLength), FormatType.Doc); >// Start Replace >document.Replace("$MembershipId$", membershipId, true, true); >document.Replace("$Date$", DateTime.Now.ToLongDateString(), true, true); >document.Replace("$Address$", address.ToString(), true, true); >document.Replace("$SubscriptionGrade$", member.SubscriptionGrade, true, true); >document.Replace("$RenewalDate$", member.RenewalDate, true, true); >document.Replace("$Name$", member.Title + " " + member.Surname, true, true); >// End Replace >document.Save("Template.doc", FormatType.Doc, context.Response, HttpContentDisposition.InBrowser);

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.

;