< Back

Document Subject: Export to Excel from Web Browser
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#WebExcelExport or http://A555F9/nn.nsf/ByAlias/WebExcelExport

Customer required printing and exporting of selected documents from web search results to Excel. Fortunately the existing database had excel export code already in, I adapted it to work with selected search results.
Create a lotusscript agent that is called with the view and selected documents. The secret to export to excel is this line: Print "Content-Type:application/vnd.ms-excel" 'Then you need to start to define the columns and data: Print "Excel from Web" 'Optionally put in some CSS code to format the headings nice: print|| 'Put the headings in print || print || print || print || 'Then put in your data lines ' maybe using a loop print || print || print || print || print || print || print || print || 'Then finish off Print "
Heading 1Heading 2
Row 1 Col1Row 1 Col2
Row 2 Col1Row 2 Col2
" Nice an easy. Of course this might work with Open Office as well. If you have the vnd description you can use that to change it to Open Office. For people wothout excel, you can output the data as Content-type: text/csv Another option is to end the agent's url with the text file type eg: http://server/db.nsf/agent?open&.csv or .xls I do this with RSS and it works well. &.xml