2

Can import the data from Excel file easily. But while importing the data the Superscript,it cannot be fetched in the same format from the Excel file.

While importing n2 from the file it appears as n2, Similarly for the other superscript variables too.

I have used PHPExcel to import the excel file, Using the following code $cell->getValue()->getRichTextElements(); can add the <sup> before and </sup> after the superscript text and save it in DB.

Above method will appear properly for the WEB, I also have the iOS app, when I send the data to iOS, the <sup> and </sup> is also shown along with the text.

Is there a way to solve it, with out adding the superscript tag for WEB, so that it appears properly in iOS.

Thanks in Advance.

Siva.G ツ
  • 831
  • 1
  • 7
  • 20
logan Sarav
  • 781
  • 6
  • 27
  • of course it'll render in "web" - you're displaying html in a web browser. it'll get rendered. unless you tell ios it's display html, it'll treat html tags as any other text... – Marc B May 25 '15 at 17:30
  • @MarcB, the app i am creating is not the hybrid app, it's a native one. So i cannot display text as html in it. – logan Sarav May 25 '15 at 17:34

1 Answers1

1

In your given case, the superscript is stored as HTML n<sup>2</sup>. Hence it will display correctly on a web page. (Because it is rendering HTML n<sup>2</sup>. If however, you are rendering it in iOS app, then it will only show the text n<sup>2</sup>, because that's the actually value stored in the database.

You can render this string/text as HTML in you iOS native app, here is a question here: How to show an HTML string on a UILabel in iOS?

Or, you can store the original value in the db as some unicode (nchar, nvarchar type) to store the subscript notation. Here is a question relating to that: Inserting Superscript Numbers in MS SQL

Community
  • 1
  • 1
antoniovassell
  • 1,012
  • 14
  • 24