Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  Need help exporting a C# webform to MS Word
Previous Previous
 
Next Next
New Post 2/14/2008 2:29 PM
Unresolved
User is offline tkota
3 posts
10th Ranked


Need help exporting a C# webform to MS Word 

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 7:50 AM
User is offline Mitch Sellers
5820 posts
www.mitchelsellers.com
3rd Ranked




Re: Need help exporting a C# webform to MS Word 

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
MCITP, MCPD, MCTS
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 Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 2/15/2008 8:26 PM
User is offline Josh Martin
182 posts
www.dnnreactor.com
9th Ranked


Re: Need help exporting a C# webform to MS Word 

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
http://www.DNNReactor.com
 
New Post 2/15/2008 8:26 PM
User is offline Josh Martin
182 posts
www.dnnreactor.com
9th Ranked


Re: Need help exporting a C# webform to MS Word 

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
http://www.DNNReactor.com
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  Need help exporting a C# webform to MS Word
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Verndale - Web Development, Support, Hosting
Since 1998, Verndale has helped hundreds of emerging and midsize businesses maximize the value and reach of their web assets with a comprehensive offering of strategy, design, development, search marketing and support services.
www.verndale.com
Overlook Technology
Website Development, DotNetNuke Consulting, Module Development, Portal Management
OverlookTechnology.com
DeutschNetNuke = DotNetNuke in German
DeutschNetNuke provides all DotNetNuke related services in German (and English).
www.DeutschNetNuke.de

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP