首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

视图数据导入excel解决方法

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

视图数据导入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>" 


htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.EmaiAddress(0)+"</font></td>" 
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.SkypeAddress(0)+"</font></td>"
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.OnBoardDate(0)+"</font></td>"
htmlstr = htmlstr+ "<td height='19' align='center' bgcolor='#ffffff'><font size='2' color='#000000'>"+doc.ServiceType(0)+"</font></td>"
htmlstr = htmlstr+ "</tr>" 
Set doc = view.GetNextDocument(doc)
Wend
htmlstr = htmlstr+ "</table>"

Print htmlstr 
errmsg: 
If Cstr(Erl) = "0" Then 
Msgbox "代理程序成功执行完毕!" 
Else 
Msgbox "代理程序出错..出错行数为:" & Cstr(Erl) & "行!错误原因为:" & Error 
End If 
End Sub

热点排行