c# - OpenOfficeXML and HTML written to spreadsheet's cells -


i have been trying write html content excel spreadsheet's cells using excelpackage openofficexml , c#.

i getting errors stating input string has invalid token. has came across similar?

saving html directly in excel works ok.

i not want use html encoding content has in readable form.

without knowing more of specifics:

if you're using xml create spreadsheet, should use cdata tags html content

  <someentry> <![cdata[ html here ]]> </someentry> 

in c# can add cdata. type of element.

xmlcdatasection cdata; cdata = doc.createcdatasection("<somenodename><h1>blah</h1></somenodename>"); xmlelement root = doc.documentelement; root.appendchild(cdata);       

otherwise, need escape quotes , double quotes \" \'

or can use system.security.securityelement.escape() encode both single , double quotes.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -