当前位置: 代码迷 >> Lotus >> 视图数据导入excel解决方法
  详细解决方案

视图数据导入excel解决方法

热度:191   发布时间:2016-05-05 07:14:59.0
视图数据导入excel

如何把不同的视图数据导入excel
excel的格式有很多种
用控制excel行和列的方法,请大家指教 


------解决方案--------------------
CSDN的.NET论坛,给你一段代码做参考吧。这个是B/S中经常用到的。
Sub Initialize
On Error Goto errmsg 

Print |Content-Type:application/vnd.ms-excel;charset=GBK| 
Print |<meta http-equiv="Content-Type" content="text/html; charset=GBK">| 
Dim s As New notessession 
Dim doc As NotesDocument 
Dim db As NotesDatabase 

Dim view As NotesView 
Dim htmlstr As String 

Set db = s.CurrentDatabase
Set view = db.GetView("Notes_GroupPersonList")

htmlstr = htmlstr & "<table border=1>" 
htmlstr = htmlstr &"<tr>" 
htmlstr = htmlstr &"<td colspan='8' align='center'><b>"+DateStr$+"********************"+"</b></td>" 
htmlstr = htmlstr &"</tr>" 
htmlstr = htmlstr & "<tr>" 
htmlstr = htmlstr & "<td width='8%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>" 
htmlstr = htmlstr & "<td width='8%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>" 
htmlstr = htmlstr & "<td width='15%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>" 
htmlstr = htmlstr & "<td width='10%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>" 
htmlstr = htmlstr & "<td width='15%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>"
htmlstr = htmlstr & "<td width='15%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>" 
htmlstr = htmlstr & "<td width='30%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>Skype</font></b></td>"
htmlstr = htmlstr & "<td width='30%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>"
htmlstr = htmlstr & "<td width='30%' height='19' align='center' bgcolor='#666666'><b><font size='2' color='#ffffff'>*******</font></b></td>"
htmlstr = htmlstr & "</tr>" 
Set doc = view.GetFirstDocument
While Not(doc Is Nothing)
htmlstr = htmlstr+ "<tr>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.CName(0)+"</font></td>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.CompanyName(0)+"</font></td>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.WorkSummary(0)+"</font></td>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.Phone(0)+"</font></td>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.Mobile(0)+"</font></td>" 
  相关解决方案