• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps App create microsoft word documents?

  • Thread starter Thread starter Member1097418
  • Start date Start date
M

Member1097418

Guest
My current app I'm developing needs to create word documents (.doc) to display full on reports for my users. Is this possible?

The idea is after the user fills in a few text views, the app gathers that data and inputs it in a new word doc, kind of like a generator to generate essays/legal documents.

Thanks
 
You will need to find the structure of the .doc format. If I remember correctly, the ,doc format is a binary format, so it's not as simple as just opening it in a text editor. You should be able to find the structure on the web somewhere though. You could also use the newer .docx format which is just an XML file, so it can be read using any text editor, so you can easily figure out the structure yourself if you really wish.

Lastly, there are likely preexisting java libraries out there that will do this for you, so I would look for one of those before diving into file structures.
 
You will need to find the structure of the .doc format. If I remember correctly, the ,doc format is a binary format, so it's not as simple as just opening it in a text editor. You should be able to find the structure on the web somewhere though. You could also use the newer .docx format which is just an XML file, so it can be read using any text editor, so you can easily figure out the structure yourself if you really wish.

Lastly, there are likely preexisting java libraries out there that will do this for you, so I would look for one of those before diving into file structures.

HA! Got it! All it took was a simple "Save-As" and Word XML was one of the options.

Thanks, now I just have to go through the mess that Microsoft has on these files.
 
Thanks jonbonazza, It helped me a lot!


John, if you ever figure out how to use any of the libraries or know a better way of doing this let us know. I was trying to get java2doc to work with no luck so I'm just going to create the .doc the hard way with xml.
 
Just thought I'd shoot an update on this. I couldn't figure out a way to create .doc in java. I tried writing to a new .doc file with java, I also tried using the built in XMLParser and also tried with strings and it just wasn't working.

The solution I'm going for? ASP .NET to create the file and Android web view to connect to webpage. The only problem I'm facing is being able to get the web view to accept the .doc download. Anyone experience with accepting downloads on web views?

If not I'll just have ASP .NET create the file and e-mail it. Instead of creating too much overhead for my app, ASP .NET servers will pick up the heavy lifting.
 
Back
Top Bottom