Link to home
Create AccountLog in
Avatar of carter-greenan
carter-greenan

asked on

What control should I use to display a rich text document?

Hi, I need to view either SQL report or a rich text document based on the value selected in a drop down list. Is there a control that will display both? If not, I know I can use the report viewer control for the report, but what can I use for the text document? I will need to be able to print the document. Please help, I am being shouted at!!!
Avatar of omegaomega
omegaomega
Flag of Canada image

Hello, carter-greenan,

I don't know of a control to do both.  

If your users have Word available, why not use that for the Richtext document.  It would make printing very simple.  

Cheers,
Randy
Avatar of carter-greenan
carter-greenan

ASKER

Hi Randy, thanks, but it is a Web App, so it needs to be 100% interoperable. There must be some way I can display a simple, printable form?!?
Hello carter-greenan,

How about this?

Fancy Textboxes
http://steveorr.net/freecontrols/textboxes.aspx

Writing Your Own RTF Converter
http://www.codeproject.com/KB/recipes/RtfConverter.aspx

Regards,

Rimvis
Hi Rimvis,

I have purchased this control, but there does not seem to be a LoadFile property, so I can't work out how to load the document depending on the result of the drop down. I am not trying to tag on another question, but could you just tell me if I'm being really stupid?

Thanks,

Pete
>>I have purchased this control

Which one?
The FreeTextBox Professional control from http://steveorr.net/freecontrols/textboxes.aspx
It looks like FreeTextBox doesn't suport RTF format
http://freetextbox.com/forums/thread/6452.aspx



I would go for the second option:

Writing Your Own RTF Converter
http://www.codeproject.com/KB/recipes/RtfConverter.aspx
Hi, thanks, I have tried this control but seem to have exactly the same problem. I am assigning the file contents using the following code, but it is returning the output as below!!! :(

   if (DropDownList1.Text == "Coverage For Final Assesesment Submissions")
        {
            Rte1.Text = System.IO.File.ReadAllText("D:\\Akemii\\Template1Coverpageforfinalassessmentsubmissions.rtf");
        }


{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch13\stshfloch0\stshfhich0\stshfbi0\deflang2057\deflangfe2057{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} {\f13\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt Arial Unicode MS};}{\f37\fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@SimSun;}{\f38\froman\fcharset238\fprq2 Times New Roman CE;} {\f39\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f41\froman\fcharset161\fprq2 Times New Roman Greek;}{\f42\froman\fcharset162\fprq2 Times New Roman Tur;}{\f43\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\f44\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f45\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f46\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f48\fswiss\fcharset238\fprq2 Arial CE;} {\f49\fswiss\fcharset204\fprq2 Arial Cyr;}{\f51\fswiss\fcharset161\fprq2 Arial Greek;}{\f52\fswiss\fcharset162\fprq2 Arial Tur;}{\f53\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f54\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);} {\f55\fswiss\fcharset186\fprq2 Arial Baltic;}{\f56\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0; \red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red63\green73\blue86;} {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang2057\langfe2057\loch\f0\hich\af0\dbch\af13\cgrid.............
What control is Rte1?
It is the Rich TextEditor from CodePlex
ASKER CERTIFIED SOLUTION
Avatar of Rimvis
Rimvis
Flag of Lithuania image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Thanks for this. I have downloaded this control, but to be honest I think I am totally out of my depth with it!

All I want to do is display a formatted document in my web site with a print button! Is there no idiot-proof way of doing this?