C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Rich Text box Copy command not working in web server Posted by krishnansmail on 28 May 2009 at 12:36 AM
Hi,

The below code is working well in my local machine, but when I upload and test it in a Windows server 2003 (web server) , it is not merging the document.

1 System.Windows.Forms.RichTextBox rTxt1 = new System.Windows.Forms.RichTextBox();
2 System.Windows.Forms.RichTextBox rTxt2 = new System.Windows.Forms.RichTextBox();
3
4 if (strWordContent == "")
5 {
6 strWordContent = strMyNewWordContent;
7 strFinalWordContent = strWordContent; //Assign the value to the final variable
8 }
9 else
10 {
11 rTxt2.Rtf = strFinalWordContent; //Get the value from the final variable and store it in a 2nd RTF editor
12 strWordContent = strMyNewWordContent;
13
14 rTxt1.Rtf = strWordContent;
15 string str = rTxt1.Rtf.ToString();
16 int index = str.LastIndexOf('}');
17 string str1 = str.Insert(index, "\\page\\par\r\n"); //Adding the page break
18 rTxt1.Rtf = str1;
19
20 rTxt1.SelectAll();
21 rTxt1.Copy();
22 rTxt2.Paste(); //Copy and paste it in the second document.
23
24 strFinalWordContent = rTxt2.Rtf; // Get the content form 2nd RTF to final variable
25
26 rTxt2.Clear();
27 rTxt1.Clear();
28 }

My Server Details:

Dot Net Version : 3.5
OS : Windows Server 2003
Office Version : MS Office 2003
Platform : ASP.Net with C#
Application Type : Web application


After statement rTxt2.Paste() is excuted , the previous values is presented in the rTxt2. (the copy and paste command is not working)



Please help on this.

Thanks & regards,
Navaneethakrishnan T
Report
Re: Rich Text box Copy command not working in web server Posted by Psightoplazm on 28 May 2009 at 12:50 PM
you might try something like sticking a doevents inbetween the selectall, copy, and paste statements to allow processing to occur (this is just a guess)

What are you ultimately trying to accomplish here?

I often find that if I am having a problem that isn't well documented it is because not many people are running into it. If that is the case then the real underlying issue might be the design or the strategy that I am using to accomplish my ultimate goal.

If you post what you are ultimately trying to do then there might actually be an all together better solution available.
></\/~Psightoplasm`~



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.