Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Excel supported XML in iPhone

I want to create Excel supported xml file in iPhone. How to embed the image in the xml file and the image is present in my resource folder? I want to attach this xml file in mail and send to others. Others should be be able to open the xml file as Excel sheet and see the text and images.

I followed this link for creating xml file.

like image 638
Warrior Avatar asked Nov 04 '22 20:11

Warrior


1 Answers

Well, your example shows old xml Excel format used in Office 2003. However default double-click will, in most cases, open file in XML associated app, not in Excel. "Real" Excel 2007+ "xlsx" format is a ZIP archive with a set of xml files inside. If your excel file is relatively small and simple then I suggest you to use following approach:

  1. Create a template Excel file with your desired content;
  2. Extract content of the file, and study it. That you need is repeating pattern of the rows with your data. You can search xml files for your data values to easily locate that you need;
  3. Locate and study repeating pattern with data;
  4. Create a template XML file to store your data (you can use some placeholder mark there to put data);
  5. Then, to create a new Excel file, just fill template XML file with data via string manipulation (as in your example) and put it into your template XLSX file (manupulate it as with zip archive), add additional files into Excel file if requred (images).
like image 136
Petr Abdulin Avatar answered Nov 09 '22 07:11

Petr Abdulin