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  |  

telerik -- supercharge your DNN websites
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


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
5818 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.

 


Code 5 Systems, LLC.
The DNN Missing Link: A Form Module. Form Master 1.6 is an intuitive Form Creation Module at a great price. Quality Custom Module development, and DNN consulting services.
www.code5systems.com
SSL Enabled and Amazingly FAST...
SSL enable your DNN web site with SSLRedirect, compress your DNN web site HTTP data flow by up to 75%-90% with HttpCompressionAgent, and monitor your DNN web site's performance with WebKeepAlive...
www.sanibellogic.com
Ultra Media Gallery & Video Gallery
The most popular photo gallery and video gallery module. with Flash interface.
www.bizmodules.net

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