[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

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!!!
0
carter-greenan
Asked:
carter-greenan
  • 6
  • 5
1 Solution
 
omegaomegaDeveloperCommented:
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
0
 
carter-greenanAuthor Commented:
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?!?
0
 
RimvisCommented:
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
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
carter-greenanAuthor Commented:
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
0
 
RimvisCommented:
>>I have purchased this control

Which one?
0
 
carter-greenanAuthor Commented:
The FreeTextBox Professional control from http://steveorr.net/freecontrols/textboxes.aspx
0
 
RimvisCommented:
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
0
 
carter-greenanAuthor Commented:
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.............
0
 
RimvisCommented:
What control is Rte1?
0
 
carter-greenanAuthor Commented:
It is the Rich TextEditor from CodePlex
0
 
RimvisCommented:
I'm not sure this control supports RTF either.
To display your file in web browser, you need to convert RTF to HTML. Have you tried RtfConverter from CodeProject?
0
 
carter-greenanAuthor Commented:
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?
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now