将视图数据引出EXCEL文件的LOTUSSCRIPT程序设计
2004-07-31 21:35
148 查看
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As Notesdocument.nbsp
Dim excelApplication As Variant
Dim excelWorkbook As Variant
Dim excelSheet As Variant
Dim i As Integer
Dim Mood As String
Dim selection As Variant
On Error Goto Err1
Set excelApplication = CreateObject("Excel.Application")
Set excelWorkbook = excelApplication.Workbooks.Add
Set excelSheet = excelWorkbook.Worksheets("Sheet1")
'定义excel的列值
excelSheet.Cells(1,1).value = "序号"
excelSheet.Cells(1,2).value = "项目编码"
excelSheet.Cells(1,3).value = "项目型号"
excelSheet.Cells(1,4).value = "项目描述"
excelSheet.Cells(1,5).value = "维护人员"
excelSheet.Cells(1,6).value = "备注"
i = 1
Set db = session.CurrentDatabase
'获取视图
Set view = db.GetView("项目清单")
Set doc = view.GetFirstdocument.nbsp
While Not(doc Is Nothing)
i = i + 1
'定义域名
excelSheet.Cells(i,1).value = i-1
excelSheet.Cells(i,2).value = doc.P_Code(0)
excelSheet.Cells(i,3).value = doc.P_Name(0)
excelSheet.Cells(i,4).value = doc.P_Desc(0)
Print "引出第" & I & "个记录成功,请稍候!"
Set doc = view.GetNextdocument.doc)
Wend
excelWorkbook.SaveAs("c:/项目清单.xls")
Msgbox "报表引出成功,请到C盘根目录下查找!",48,"提示"
excelApplication.Quit
Set excelApplication = Nothing
Exit Sub
Err1:
Msgbox "发生错误,请与管理员联系!",48,"提示"
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As Notesdocument.nbsp
Dim excelApplication As Variant
Dim excelWorkbook As Variant
Dim excelSheet As Variant
Dim i As Integer
Dim Mood As String
Dim selection As Variant
On Error Goto Err1
Set excelApplication = CreateObject("Excel.Application")
Set excelWorkbook = excelApplication.Workbooks.Add
Set excelSheet = excelWorkbook.Worksheets("Sheet1")
'定义excel的列值
excelSheet.Cells(1,1).value = "序号"
excelSheet.Cells(1,2).value = "项目编码"
excelSheet.Cells(1,3).value = "项目型号"
excelSheet.Cells(1,4).value = "项目描述"
excelSheet.Cells(1,5).value = "维护人员"
excelSheet.Cells(1,6).value = "备注"
i = 1
Set db = session.CurrentDatabase
'获取视图
Set view = db.GetView("项目清单")
Set doc = view.GetFirstdocument.nbsp
While Not(doc Is Nothing)
i = i + 1
'定义域名
excelSheet.Cells(i,1).value = i-1
excelSheet.Cells(i,2).value = doc.P_Code(0)
excelSheet.Cells(i,3).value = doc.P_Name(0)
excelSheet.Cells(i,4).value = doc.P_Desc(0)
Print "引出第" & I & "个记录成功,请稍候!"
Set doc = view.GetNextdocument.doc)
Wend
excelWorkbook.SaveAs("c:/项目清单.xls")
Msgbox "报表引出成功,请到C盘根目录下查找!",48,"提示"
excelApplication.Quit
Set excelApplication = Nothing
Exit Sub
Err1:
Msgbox "发生错误,请与管理员联系!",48,"提示"
相关文章推荐
- 从视图引出附件文件的LOTUSSCRIPT程序设计
- SpringMVC请求转发与重定向以及视图与数据的返回
- SharePoint开发 - Excel数据导入到SharePoint自定义列表(数据视图方式)
- 数据字典动态性能表(视图)
- 强类型视图中提交表单,把View中的Model数据传递给Controller
- 删除Oracle某数据库下的所有表、视图等数据【转】
- 数据结构与程序设计 练习3.3 E7
- (三十八)从私人通讯录引出的细节II -数据逆传 -tableView点击 -自定义分割线
- 第三周数据计算实现与顺序结构程序设计的程序(二)
- MVC 5使用TempData Object跨视图传递数据
- Oracle数据字典和动态视图小结
- 《C语言及程序设计》实践项目——数值型数据的存储原理
- 由单例模式的优化,引出的java线程数据同步和类加载顺序知识点总结
- oracle数据字典详解:内部RDBMS(X$)表、数据字典表、动态性能(v$)视图、数据字典视图
- mvp 简单的案例, mvp实现登录及注册 分为moudle数据层 activity视图v层 Presenter逻辑层
- SQLite学习手册(数据表和视图)
- Flask04 后台获取请求数据、视图函数返回类型、前台接受响应数据
- sharepoint 2010 list 无法使用数据视图
- 对with check option创建的视图进行数据插入
- 第三章数程序设计初步--控制结构综合项目4-1文件操作初体验练习1从文件读取数据