When reading the Rich Text present in Excel column using open XML its taking it as plain text

Hello All,
When i am reading excel columns using open Xml in C# everything is working fine except the column that
contain Rich Text (ex: bold, italic,color,size). Its reading the Rich Text content as plain text. As we know for Rich Text in open XML we get the text as Runs (C#
object) which contains the text as value and rpr as run properties. I have also written the code to convert Runs to html. But the issue is that for some Rich Text format its reading it as Runs but most of the Rich Text its reading it as plain text.
The issue i am getting is, for some rich text its creating RUN and for some of the rich text its not creatingRUN.
Let me give the example for more understanding:
Suppose i have two cells in excel which contains the below text.
1. Rich Text
1
2. RichText
2
Now when i read these cells using the below code
var stringTable =spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().FirstOrDefault();
if (stringTable.SharedStringTable.ElementAt(index1).ChildElements.GetItem(0).GetType().Name == "Run")
Custom code to convert Rich text to HTML...
else
Read the plain text...
Though both the cell contains rich text, one is going in RUN block and one is going in Plain text bloc.
Also, one thing that i have noticed is when i use standard color for text its consider it as RUNS and when i use color apart from the standard color it does not consider it as RUNS. Same behavior occurs for different combination of text viz. bold, italic, underline
etc

Hi Ejaz,
This forum is for software developers who are using the Open Specification documentation to assist them in developing systems, services, and applications that are interoperable with Microsoft products. The Open Specifications can be found at:
http://msdn.microsoft.com/en-us/library/cc203350(PROT.10).aspx. Since your post does not appear to be related to the Open Specification documentation set, we would appreciate it if
you could try to post your question in a more relevant forum. Thank you.
Open XML Format SDK
https://social.msdn.microsoft.com/Forums/en-US/home?forum=oxmlsdk&filter=alltypes&sort=lastpostdesc
Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

Similar Messages

  • Render HTML inside Excel, using Open XML

    Hello guys,
    I am creating excel file using, Open XML.
    The data will be coming from database, and can contain HTML tags.
    e.g. <b>some sample <i style='color:red'> text </i></b>
    I want the HTML to be rendered inside excel sheet, so that user can view well formatted excel..
    Please, Help me out

    Hi J_Prasanna,
    I'm afraid that it's not possible with OpenXML SDK, but it's possible if you use Excel PIA along with Internet Explorer. Use the Internet Explorer COM object to render the HTML content, then copy the document, use the Paste method of the Worksheet object
    to paste the text with format.
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    .Visible = False
    .Navigate "about:blank"
    .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
    .document.body.createtextrange.execCommand "Copy"
    ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
    .Quit
    End With
    The code is similar if you use managed project.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error when reading the access data(URL,user, password) for Adapter Engine

    Hi,
    We are getting this error in production system 
    "SXMBSysErrorAlerts, Category INTERNAL, Error code: AE_DETAILS_GET_ERROR error text: Error when reading the access data (URL, user, password) for the Adapter Engine".
    Please tell what can be the cause of error. Where are the access data (URL, user, password) for the Adapter Engine read from?
    Its urgent.  We are in support project.
    regards,
    john

    Hi jhon,
              please check the following threads to resolve the problem.
    AE_DETAILS_GET_ERROR
    Error : no_adapter_engine_found: Unable to find Adapter Engine
    regards
    mahesh.

  • Error when reading the data of infoprovider

    Hello,
    I have a problem when excecuting the transaction 'listcube' on a specific infocube. It occurs an error message which complains problem when reading the data of the infoprovider. The message text sounds as follows:
    Error reading the data of InfoProvider ZDPPTGR1
    Message no. DBMAN305
    Diagnosis
    Errors occurred while reading a VirtualProvider outside the BI system. Check whether the previous error messages contain any information about the possible cause of this error.
    It is possible that the error message cannot be displayed because the error message class does not exist in the BI system. If this is the case, only the name of the error class and the message number are displayed. View the error message text in the specified error class in the source system of the VirtualProvider.
    Procedure
    Since the error is not necessarily in the BI system, there is no specific procedure for resolving it. With VirtualProviders, problems often occur with the connection to the remote system; these can lead to system termination. If the code for the VirtualProvider is not from SAP, contact the relevant contact person to help resolve the issue.
    If an SQL error is listed in the previous message, see the procedure for SQL errors.
    Has anybody experience with solving this problem? It sounds like a bigger problem - can somebody confirm this? Or is it a problem which is easy to solve?
    Thanks for answering!
    Kind regards
    Heinz

    Hi,
    Please follow the below threads. They are similar to the error you are facing and they may help you with the issue ::
    Remote cube - uncaught exception
    DBMAN350 Error reading MultiCube data over aggregate
    Error reading the data of InfoProvider 0TCT_VC01
    Regards,
    Arpit

  • I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password pro

    I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password protecting the document?

    Is there a setting that needs to be set to allow the annotation features?  I set password protection to open and then password for editing and set it to Any except page extraction, but it still did not give the annotation option

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • Error when reading the ID of the business system from the SLD

    Hi,
    I am working on a scenario JDBC - XI - BW (ABAP Proxies). I configured all the steps required to connect XI & BW systems. The SLDCHECK transaction is all green. I was able to connect to SLD from BW using SXMB_IFR tcode too. I was able to look at all the XI Repository interfaces from SPROXY tcode in BW. Created a new ABAP proxy (class interface and method) for the message interface in XI from BW (SPROXY Tcode). Created all required config in XI Directory. Got the message from JDBC adapter, mapping done successfully, and the message failed in the CALL Adapter Step.
    The error is "Error when reading the ID of the business system from the SLD for system BWS and client 100."
    What could have gone wrong. Thanks in advance.
    Srini

    Hi,
    :::::::One Should Have the Following Roles AS A XI Developer With Out Admin Rights ::::::
    1) SAP_XI_Developer_ABAP +
    2) SAP_XI_Developer_J2EE  +
    3) SAP_XI_MONITOR_ABAP   +
    4) SAP_XI_MONITOR_J2EE    +
    5) SAP_SLD_ADMINISTRATOR +
    6) SAP_XI_BPE_MONITOR_ABAP +
    7) SAP_XI_DEMOAPP
    8) SAP_XI_DISPLAY_USER_ABAP +
    9) SAP_XI_DISPLAY_USER_J2EE +
    Regards
    Sesh

  • Error when reading the access data for the Adapter Engine

    We are getting the following error in XI. It started on Jan 22 and resolved on Jan 23 automatically. Nothing has been changed and we don't able to understand how problem started and how it resolved:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
      <SAP:P1>af.xpd.dbcixpd</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>3: Unable to find URL for Adapter Engine af.xpd.dbcixpd</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when reading the access data (URL, user, password) for the Adapter Engine af.xpd.dbcixpd</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    Pls suggest if anyone has gone thru same problem.
    Regards
    Amar

    I got the same problem while using RFC lookup.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
      <SAP:P1>af.tx1.netweaver</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>3: Unable to find URL for Adapter Engine af.tx1.netweaver</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when reading the access data (URL, user, password) for the Adapter Engine af.tx1.netweaver</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Any idea ,when we get this error usually.

  • Error when reading the DDIC-data for table

    Hi Tobias
    We upgraded from DMIS 2011 SP04 to SP07. We are in development system.
    To test initial load, we stopped replication for an existing table and then started replication for the same table.
    Mass transfer id connects ECC system to BW on HANA system.
    Replication errored with the following message:
    Error when reading the ddic-data for table MARD (RFC destination DWACLNT010).
    Looking for your guidance.
    Kind Regards
    Kamaljit Vilkhoo

    Was able to solve using oss note 1972533.

  • Read error when reading the master data of 0EMPLOYEE on demand, attribute 0

    Hello All,
    While loading data for HR data source 0HR_PA_OS_1 i am getting the below error message..
    Error 1 in update.
    Read error when reading the master data of 0EMPLOYEE on demand, attribute 0COMP_CODE
    Please let me know how can it be resolved.
    Regards
    Rohit Parti

    The problem occurs during data load from R/3. It was not occuring before. When I go to check the PSA contents I get a runtime error - GETWA_NOT_ASSIGNED.
    Error analysis                                                      
        You attempted to access an unassigned field symbol              
        (data segment 32821).                                                                               
    This error may occur if                                         
        - You address a typed field symbol before it has been set with  
          ASSIGN                                                        
        - You address a field symbol that pointed to the line of an     
          internal table that was deleted                               
        - You address a field symbol that was previously reset using    
          UNASSIGN or that pointed to a local field that no             
          longer exists                                                 
        - You address a global function interface, although the         
          respective function module is not active - that is, is        
          not in the list of active calls. The list of active calls     
          can be taken from this short dump.

  • N WIKI: 'A failure on the server has appeared when reading the settings'

    Hallo,
    I get the following notice of failure after opening Server WIKI: 'A failure on the server has appeared when reading the settings'. I've no idea WHY, WHAT, HOW, and WHERE - is there somebody who can help me? Anything else is working.
    Regards Jergan

    What OS are you running? Is it 10.5 as noted in your profile? Also, is it the Server version?
    If so, try these forums: Mac OS X v10.5 Leopard, Mac OS X Server v10.5

  • WIKI: 'A failure on the server has appeared when reading the settings'

    Hallo,
    I get the following notice of failure after opening Server WIKI: 'A failure on the server has appeared when reading the settings'. I've no idea WHY, WHAT, HOW, and WHERE - is there somebody who can help me? Anything else is working.
    Regards Jergan

    What OS are you running? Is it 10.5 as noted in your profile? Also, is it the Server version?
    If so, try these forums: Mac OS X v10.5 Leopard, Mac OS X Server v10.5

  • TS3276 An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    For anyone else reading this thread, it is worth knowing that sometimes an email is, or can be, corrupted thereby jamming the works. The solution above is good, but I just wanted to suggest another one.
    If the problem arises, go to an online mail access service, such as Mail2Web.com and login to you mail account there and delete the offending message.
    Problem solved.
    And George, as this is all entirely voluntary, whinging about no takers may not endear people to you. Besides which, a few minutes of searching on Google would have found you a number of solutions.

  • My iMac suddenly can't read the backup hard drive I've been using for Time Machine.  I did NOT just upgrade the OS or anything.  The external HD is an OWC Mercury Elite All Pro. It's worked fine since I got the iMac 4 years ago.`

    My iMac suddenly can't read the backup hard drive I've been using for Time Machine.  I tried unplugging the cord that connects the HD to the iMac and plugging it back in, but I still get "The disk you inserted was not readable by this computer" below which are buttons for Initialize, Ignore and Eject.  I was using a cord that went from larger square plug to larger square plug.  So then I tried one that went from smaller square plug to what I think is USB (thin rectangular plug) of the sort that connects the keyboard and mouse. It's the type that my printers and scanners use to connect to the iMac.  I did NOT just upgrade the OS or anything.  The external HD is an OWC Mercury Elite All Pro. It's worked fine since I got the iMac 4 years ago. What else can I try before just trying to initialize and

    Thanks, Michael!  I do hear it at times spooling up and running. Just after I bumped the thread I looked for troubleshooting for this drive online and found the manual which suggested using Disk Utility which I've seen before accidentally (if I hit Command Shift U instead of Shift U to type "Unit" on a new folder for a student's homework ) but had never really noticed.   Disk Utility does see it and also a sub-something (directory?) which might be the Time Machine archives on the disk, called disk1s2), sort of the way that my iMac's hard drive shows up as 640.14 GB Nitachi HDT7... and has a sub-something titled DB iMac, which is what I named my iMac's hard drive.
    Anyway the owner's manual just shows the image under the formatting section, not the troubleshooting section, but as soon as I saw it in the manual I remembered seeing it accidentally a few times, went to it, and am now verifying the disk.  Right now it's telling me that it will take 2 hours to complete the verification, so I guess I have a bigt of a wait.  :-) 
    Does that fact that Disk Utilities can see it mean it's not failed, or just that it hasn't completely failed? 
    I can see the virtue in having multiple redundant backups, or at least two backups. What do you suggest?  Two external hard drives?  I had this one linked by ethernet, and but I also have a cord that could link it by USB (like a printer), so if this one is reparable I could get a second one and link it by USB.  If this one is not reparable I could get two and do the same thing.  I do have an Airport so I suppose it's possible to get some sort of Wi-Fi hard drive (my new printer/scanner uses only the network and not a cable, although it has a cable that I used for the initial installation), but I'd suspect a Wi-Fi hard drive might have a higher price.
    What hard drives, if any, do you recommend? I seem to recall that when I was looking at external hard drives 4 years ago, Apple's were substantially more expensive, which is why I got the OWC Mercury Elite All Pro.

  • I am having problems transefering contacts to my I pod when syncing the message comes back with contact in use by I pod please close and try again, please could you let me know how to close contacts on the  pod or is there a setting that is wrong etc,

    I am having problems transfering contacts to my I pod when syncing the message comes back with contacts in use by I pod please close and try again, please could you let me know how to close contacts on the  pod or is there a setting that is wrong etc, i have restored the device. if i go to contact via settings the screen comes on for about 2 seconds and then goes off - Help

    Single click on the Home button. Then double click on the Home button. In the recently used row, touch and hold the Contact app till they start to wiggle and then tap the minus sing by the contacts app.
    Also make sure the Contact program on your computer is closed.

Maybe you are looking for