Hi,

I am trying create financial reports in excel, so far I am successful in 
creating an excel file from python, only issue I have got it to open it from 
openerp web client.

below is the sample code to generate the excel file:
import pyExcelerator as xl
work_book_document = xl.Workbook()
doc_sheet_1 = work_book_document.add_sheet("sheet1")
my_font = xl.Font()
my_font.name = 'Time New Roman'
my_font.bold = True
my_font.underline = True
my_font.italic = True
my_font.colour_index = 3
my_font_style = xl.XFStyle()
my_font_style.font = my_font
doc_sheet_1.write(0,0,'value') # (row, column, ...)
doc_sheet_1.write(0,1,'name', my_font_style)
work_book_document.save('/usr/lib/python2.5/site-packages/openerp-server/addons/excel_export/filename.xls')

i can see the test excel file is created in the directory. Now I want to 
automatically open the excel file in the default program (e.g. openoffice or 
excel etc.)

For opening I am trying to use the following code:
import webbrowser
webbrowser.open("/usr/lib/python2.5/site-packages/openerp-server/addons/excel_export/filename.xls")

If I put this code in py file on the server than it launches web browser and 
gives me the option to open or save it. Whereas when I try this from another 
machine from openerp-web-client, nothing happens.

Any help?

Thanks
Dhariwal




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=58267#58267

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to