Generate a *.doc(x) report

796
5
10-17-2011 03:31 AM
TiagoRibeiro
Occasional Contributor
Hi,

I'm developing a Web Application using the Javascript API. I need to make a report in an editable format, preferably in .doc or .docx format. I saw the sample to generate a PDF report using Python geoprocessing. Is it possible to generate a doc file with python, and hand it back to the Web Application?

Thx.

Tiago
0 Kudos
5 Replies
BaileyLipscomb1
New Contributor
Could you use rtf?
0 Kudos
TiagoRibeiro
Occasional Contributor
Could you use rtf?


Yea, of course. It's editable, and MSWord can open it. Is it easier in rft?
0 Kudos
BaileyLipscomb1
New Contributor
I personally think it is.
0 Kudos
TiagoRibeiro
Occasional Contributor
And can you give me some example in how to accomplish it, or maybe give me some hints?
I've a got a big "to-do" list for this application, so I don't know when I'll start the report part, but it would be nice to have something to build on...
0 Kudos
BaileyLipscomb1
New Contributor
This is a small sample.

//Open the file
rtfFile=open(r"C:\test.rtf","w")
//Write to the file
rtfFile.write("Hello, World.")
//Close the file
rtfFile.close()
0 Kudos