Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i want to generate data to an excel in that,
how to convert html tags of "OL>
  • italic

    underline
  • superscript

    subscript"

    to

    VB
    1.italic
    underline
    superscript
    subscript


    any solution?
    Posted
    Comments
    lukeer 13-Sep-12 4:34am    
    You want to remove all tags?

    Look for a "<" character. Remove it and all following including the next ">" character.
    Fathima0207 13-Sep-12 4:44am    
    i dont want to remove the tags alone...i also want the text to be formatted as bold or italics from that html related tags
    Sushil Mate 13-Sep-12 5:30am    
    & where you want to show this data? excel sheet?
    Fathima0207 13-Sep-12 5:50am    
    yes ...
    actually im saving data(from screen) in database as html...while fetching those data to display in excel, i want it to be converted back to formatted text how i typed in screen...

    Try following link, It shows the data in Bold, Underline, Italic format.

    Excel-Bold Italic Underline in c#
     
    Share this answer
     
    Comments
    Fathima0207 13-Sep-12 7:44am    
    making the texts formatted is not my need...
    when i format the text in screen it is getting saved as html in database...and when that is retrieved and displayed in excel it shows as tags itself insted of formatted texts.
    Sushil Mate 13-Sep-12 7:54am    
    so your screen is excel, you are editing in excel sheet & saving in the database. After retrieving that data it shows in the tag format not in formatted text. is that what you want to say?
    Fathima0207 13-Sep-12 8:19am    
    noo...my screen is an aspx page and there i have kept an free text box where it will format the texts....the entered data are stored in database....for that column i have the datatype as text in sql...so when it is getting saved in database it is saved as html...from from database i wanna display in excel...when i do this the tags are getting displayed where i need the format text to be shown.
    Sushil Mate 13-Sep-12 8:59am    
    see as per my knowledge you need to write down your own logic to show formatted data in excel. you can just check the tag & format the cell. above link will give you head start.
    Fathima0207 13-Sep-12 9:06am    
    anyway thanks...im trying to sort it out..
    Can use below tricky method..ints in C# below..

    C#
    var webBrowser = new WebBrowser();
    webBrowser.CreateControl(); // only if needed
    webBrowser.DocumentText = *htmltext withtags*;
    while (_webBrowser.DocumentText != *yourhtmlstring*)
        Application.DoEvents();
    webBrowser.Document.ExecCommand("SelectAll", false, null);
    webBrowser.Document.ExecCommand("Copy", false, null);
    *yourRichTextControl*.Paste();
     
    Share this answer
     

    This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



    CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900