Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Visual Studio - Format text

Visual Studio - Format text

Scheduled Pinned Locked Moved Visual Studio
csharpwinformsquestiondatabasesql-server
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ravno
    wrote on last edited by
    #1

    I have developed a Windows forms application using Visual Studio 2010. A part of the application is users writing blocks of text. They are writing in multiline textboxes. The textblocks are stored in mssql as nvarchar(max) I am merging the textblocks to one document using MS ReportViewer It all Works fine, but now the users want to be able to format the text - Bold, underline and bullits etc. I haeve tried using RichTextBox and a thirdparty product TX TextControl. I can format the text and save it in my db. But how do I present the merged document to the users ? Reportviewer cannot show it. Is it possible to use Word as an editor embedded in a WinForms App ? Any help ? mvh ravno

    J L 2 Replies Last reply
    0
    • R ravno

      I have developed a Windows forms application using Visual Studio 2010. A part of the application is users writing blocks of text. They are writing in multiline textboxes. The textblocks are stored in mssql as nvarchar(max) I am merging the textblocks to one document using MS ReportViewer It all Works fine, but now the users want to be able to format the text - Bold, underline and bullits etc. I haeve tried using RichTextBox and a thirdparty product TX TextControl. I can format the text and save it in my db. But how do I present the merged document to the users ? Reportviewer cannot show it. Is it possible to use Word as an editor embedded in a WinForms App ? Any help ? mvh ravno

      J Offline
      J Offline
      joginder banger
      wrote on last edited by
      #2

      if you want present the document for user, you can save before the present. Save method mention below.

      private void Save_button_click (object sender, EventArgs e)
      {
      if(File.Exists("path of file"))
      {
      MessageBox.Show("Plz chnage your file name");

          }
             else
             {
                 File.Create("Path of the FIle where you want save with Extension, like that d:\\\\testing.txt");
                 File.WriteAllText("path of the File", "contents");
      
             }
          }
      

      for any problem faced comment left here.

      R 1 Reply Last reply
      0
      • J joginder banger

        if you want present the document for user, you can save before the present. Save method mention below.

        private void Save_button_click (object sender, EventArgs e)
        {
        if(File.Exists("path of file"))
        {
        MessageBox.Show("Plz chnage your file name");

            }
               else
               {
                   File.Create("Path of the FIle where you want save with Extension, like that d:\\\\testing.txt");
                   File.WriteAllText("path of the File", "contents");
        
               }
            }
        

        for any problem faced comment left here.

        R Offline
        R Offline
        ravno
        wrote on last edited by
        #3

        Hmm - I'm not sure I understand I can't see, how some pieces of formatted text can be merged into a *.txt and keep the formatting. mvh ravno

        1 Reply Last reply
        0
        • R ravno

          I have developed a Windows forms application using Visual Studio 2010. A part of the application is users writing blocks of text. They are writing in multiline textboxes. The textblocks are stored in mssql as nvarchar(max) I am merging the textblocks to one document using MS ReportViewer It all Works fine, but now the users want to be able to format the text - Bold, underline and bullits etc. I haeve tried using RichTextBox and a thirdparty product TX TextControl. I can format the text and save it in my db. But how do I present the merged document to the users ? Reportviewer cannot show it. Is it possible to use Word as an editor embedded in a WinForms App ? Any help ? mvh ravno

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Crystal Reports supports displaying formatting Rich Text from rtf markup. If that is not an option, you can store the formatted text as html instead of rtf and then use the WebBrowser control to display it (or simply save to html file and start the browser with the file path)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups