< 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 |
Heading 1
| print |
Heading 2
| print |
| 'Then put in your data lines ' maybe using a loop print |
| print |
Row 1 Col1
| print |
Row 1 Col2
| print |
| print |
| print |
Row 2 Col1
| print |
Row 2 Col2
| print |
| 'Then finish off Print "
" 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