Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old September 10th, 2012, 11:32 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Location: San Jacinto
Gender: Male
Posts: 14
 
Device(s): Thunderbolt, Galaxy Tab II
Carrier: Verizon

Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via Skype™ to jdg690
Question App create microsoft word documents?

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

jdg690 is offline  
Reply With Quote
sponsored links
Old September 11th, 2012, 10:33 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,936
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 478 Times in 292 Posts
Default

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.
jonbonazza is offline  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
Old September 12th, 2012, 10:11 PM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Location: San Jacinto
Gender: Male
Posts: 14
 
Device(s): Thunderbolt, Galaxy Tab II
Carrier: Verizon

Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via Skype™ to jdg690
Default

Quote:
Originally Posted by jonbonazza View Post
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.
jdg690 is offline  
Reply With Quote
Old September 14th, 2012, 08:00 PM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Location: San Jacinto
Gender: Male
Posts: 14
 
Device(s): Thunderbolt, Galaxy Tab II
Carrier: Verizon

Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via Skype™ to jdg690
Default

Quote:
Originally Posted by John Farrell View Post
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.
jdg690 is offline  
Reply With Quote
Old December 7th, 2012, 12:26 AM   #5 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Location: San Jacinto
Gender: Male
Posts: 14
 
Device(s): Thunderbolt, Galaxy Tab II
Carrier: Verizon

Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via Skype™ to jdg690
Default

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.
jdg690 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:27 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.