0

Well, I didn't find any libs to create Excel file in Windows Phone 7 and the default libs for Excel are not working because they weren't compile for it.

Does any of you guys know how to do this?

ctacke
  • 66,480
  • 18
  • 94
  • 155
Andre Mariano
  • 308
  • 1
  • 3
  • 14
  • 1
    I really doubt you can do this. Can't you use a web service layer and have the heavy work done on the server? If so, in the server, you can surely use the OpenXML SDK to handle office files. – Davide Piras Jan 16 '12 at 12:58
  • if your file is simple enough you could go for a csv file instead of a full fledged excel sheet – thumbmunkeys Jan 16 '12 at 13:00
  • I was trying to avoid any online operation, and unfortunatelly it's my sheet isn't tha simple =/ I hope someone come up with a solution. – Andre Mariano Jan 16 '12 at 13:02
  • You could get the [EPPlus](http://epplus.codeplex.com) source code and try to compile it for WP7... – Nuffin Jan 16 '12 at 13:12

2 Answers2

3

Excel is able to open many different kinds of files beyond the .xls or .xlsx. Most common is CSV; it's dead simple but not very capable, and I would avoid it for all but the simplest applications.

A format I've used successfully is the Symbolic Link (SYLK) format. The .slk files open directly in Excel, and you can include cell formatting and formulas. It's easy to save out a file from Excel itself and use it as a template for creating your own files.

Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
  • SYLK doesn't support Unicode, though, which probably makes it a poor choice nowadays. – Joey Jan 16 '12 at 16:51
  • Thats a good solution for my case, because I'm writing for only one country. Thanks – Andre Mariano Jan 16 '12 at 17:25
  • @Joey, I just tried it - when Excel 2010 wrote out the file it substituted a `?` for the Unicode `π`. Unfortunately you're right. I don't know how it would treat UTF-8 in the input but I expect it fares just as badly. – Mark Ransom Jan 16 '12 at 17:50
0

You're going to struggle to find a library to do this simply because WP (as of 7.1) doesn't include the System.IO.Packaging namespace, which most libraries will depend on to read/write docx/xlsx/etc files.

Richard Szalay
  • 83,269
  • 19
  • 178
  • 237