Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Need help exporting a C# webform to MS WordNeed help exporting a C# webform to MS Word
Previous
 
Next
New Post
2/14/2008 5:29 PM
 

Hello,  I am developing a webform, which when submitted emails the form and/or fields as word attachment. To generate the web form as word document I have used below lines:

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();

 

HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);StreamWriter objStreamWriter = File.AppendText(strFilepath);

 

 

Panel1.RenderControl(oHtmlTextWriter);

objStreamWriter.WriteLine(oStringWriter.ToString());

objStreamWriter.Close();

Using smtpdotnet, I am emailing this word attachment. The problem is that the word document generated does not look straight. Fields are not properly aligned and margins are messed up with the result that the print-out does not even print the entire document. Can you suggest if there is a better approach to the solution above to render a clean-looking word document? Would you recommend any third party tools or components for ASP.NET 2.0? Any help is appreciated. Thanks.

 

 

 
New Post
2/15/2008 10:50 AM
 

I would strongly recommend looking into other solutions as it will most likely net you a better result.  You can either write your own method that uses word automation to accomplish the job or look into third party tools.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
2/15/2008 11:26 PM
 

Again I have to agree with Mitch.  I do not see how your writting a "word" docuement with stringwritter, or html writter.  thats just for writting straight txt files isn't it?  don't you need a writter to add the MS word data(IE size, color..more than ANSI stuff?)

Check this post out.  I have no clue who they are, or what they charge for thier library, but I'm sure MS has one too now that I think of it, probably in the office dev kit or something.

http://forums.asp.net/t/1200332.aspx

 


Josh Martin

 
New Post
2/15/2008 11:26 PM
 

Again I have to agree with Mitch.  I do not see how your writting a "word" docuement with stringwritter, or html writter.  thats just for writting straight txt files isn't it?  don't you need a writter to add the MS word data(IE size, color..more than ANSI stuff?)

Check this post out.  I have no clue who they are, or what they charge for thier library, but I'm sure MS has one too now that I think of it, probably in the office dev kit or something.

http://forums.asp.net/t/1200332.aspx

 


Josh Martin

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Need help exporting a C# webform to MS WordNeed help exporting a C# webform to MS Word


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out