SNTT : Export any Lotus Notes View to Excel from Domino Web, automagically
Posted under Show-n-Tell+Thursday, Lotus Domino, on Thursday, December 14th, 2006;As an update to Export any Lotus Notes View to CSV or Excel, automagically, and as an answer to a being asked how you would do this, here is some similar code to export a view from the web brower to Excel :
Import it into a Lotus Script Agent, and call it with a url like http://ServerName/YourDatabase.nsf/WebAgentName?OpenAgent&ViewNameToExport
The Initialize routine parse’s the ViewNameToExport off of the Query String, and opens that view object.
The tricky/clever/sneaky part is the :
Print |Content-Type:application/vnd.ms-excel|
which will create and open (if excel is a registed application) the spreadsheet sheet.
You can also do something like this, after that line,:
Print |Content-disposition: attachment; filename=| & ViewName & |.xls|
which we let you set the filename of the spreadsheet.
You can also do a bunch more formating of the table cells, and I believe you can pass thur some Excel formulas. (see Microsofts’ Excel Web Connectivity Kit for more details on this.)
See (new father) Jake Howlett’s excelent CodeStore article on Keeping the boss happy for more variations. Enjoy (technorati.com tags :Show-n-Tell+Thursday, SnTT)
See also

January 6th, 2007 at
I have found recently that using application/msexcel is a little more forgiving than using application/vsd.ms-excel for Content-Type. The latter one is newer and not always setup on the server.
Sean—