'******************************************************************************
'* File: pdm2excel.vbs
'* Purpose: 分目录递归,查找当前PDM下所有表,并导出Excel
'* Title:
'* Category:
'* Version: 1.0
'* Author: huhaicool@sina.com
'******************************************************************************
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
' get the current active model
Dim mdl ' the current model
Set mdl = ActiveModel
Dim EXCEL,sheet,rowsNum
rowsNum = If (mdl Is Nothing) Then
MsgBox "There is no Active Model"
Else
SetExcel
ListObjects(mdl)
End If
'-----------------------------------------------------------------------------
' Sub procedure to scan current package and print information on objects from current package
' and call again the same sub procedure on all children pacakge
' of the current package
'-----------------------------------------------------------------------------
Private Sub ListObjects(fldr)
output "Scanning " & fldr.code
Dim obj ' running object
For Each obj In fldr.children
' Calling sub procedure to print out information on the object
DescribeObject obj
Next
' go into the sub-packages
Dim f ' running folder
For Each f In fldr.Packages
'calling sub procedure to scan children package
ListObjects f
Next
End Sub
'-----------------------------------------------------------------------------
' Sub procedure to print information on current object in output
'-----------------------------------------------------------------------------
Private Sub DescribeObject(CurrentObject)
if not CurrentObject.Iskindof(cls_NamedObject) then exit sub
if CurrentObject.Iskindof(cls_Table) then
ExportTable CurrentObject, sheet
else
output "Found "+CurrentObject.ClassName+" """+CurrentObject.Name+""", Created by "+CurrentObject.Creator+" On "+Cstr(CurrentObject.CreationDate)
End if
End Sub Sub SetExcel()
Set EXCEL= CreateObject("Excel.Application") ' Make Excel visible through the Application object.
EXCEL.Visible = True
EXCEL.workbooks.add(-)'添加工作表
EXCEL.workbooks().sheets().name ="pdm"
set sheet = EXCEL.workbooks().sheets("pdm") ' Place some text in the first Row of the sheet.
sheet.Cells(rowsNum, ).Value = "表名"
sheet.Cells(rowsNum, ).Value = "表中文名"
sheet.Cells(rowsNum, ).Value = "表备注"
sheet.Cells(rowsNum, ).Value = "字段ID"
sheet.Cells(rowsNum, ).Value = "字段名"
sheet.Cells(rowsNum, ).Value = "字段中文名"
sheet.Cells(rowsNum, ).Value = "字段类型"
sheet.Cells(rowsNum, ).Value = "字段备注"
End Sub Sub ExportTable(tab, sheet)
Dim col ' running column
Dim colsNum
colsNum =
for each col in tab.columns
colsNum = colsNum +
rowsNum = rowsNum +
sheet.Cells(rowsNum, ).Value = tab.code
sheet.Cells(rowsNum, ).Value = tab.name
sheet.Cells(rowsNum, ).Value = tab.comment
sheet.Cells(rowsNum, ).Value = colsNum
sheet.Cells(rowsNum, ).Value = col.code
sheet.Cells(rowsNum, ).Value = col.name
sheet.Cells(rowsNum, ).Value = col.datatype
sheet.Cells(rowsNum, ).Value = col.comment
next
output "Exported table: "+ +tab.Code+"("+tab.Name+")"
End Sub

PowerDesigner导出所有表到Excel(同一表格)的更多相关文章

  1. 关于PowerDesigner导出数据库表到word文档

    关于PowerDesigner导出数据库表到word文档 一.查看全部模板: powerdesigner默觉得我们提供了非常多的模版,在工具栏中选择[Report(报告)--->Report T ...

  2. PowerDesigner导出word表结构

    一.wordTemplate.rtp下载 首先下载wordTemplate.rtp,将该文件放在一下路径下 C:\Program Files (x86)\Sybase\PowerDesigner 16 ...

  3. PowerDesigner导出建表sql脚本

    1 按照数据库类型,切换数据库. Database-> Change Current DBMS... 2.设置保存路径和文件名称

  4. PHP用PHPExcel导出有多个工作表的Excel表格(thinkPHP3.2.3)

    直接上代码: //导出excel public function excel() { //引入相关文件 import("Org.Util.PHPExcel"); import(&q ...

  5. PowerDesigner数据库设计PDM基于Excel的导入导出总结

    经常用到pdm来管理代码,一两张表,手写一下还凑合,一旦表多了,就慌了.于是,开始学习用vbs进行Excel的来快速导入导出操作PDM就变得很紧急了,搜罗了网络上的很多vbs脚本,各有各的优点,但对于 ...

  6. Powerdesigner 导出Excel格式数据字典 导出Excel格式文件

    版权声明:本文为博主原创文章,转载请注明出处; 网上我也看到了很多的Powerdesigner 导出方法,因为Powerdesigner 提供了部分VBA功能,所以让我用代码导出Excel格式文件得以 ...

  7. 导出----用Excel导出数据库表

    根据条件导出表格: 前端 <el-form-item label=""> <el-button type="warning" icon=&qu ...

  8. vue多个数据不一样的表格导出到同一张excel里面

    刚来公司第二天, 甩了个需求, 把两个不同表格的数据 导出到同一个excel中 ........额,好吧 你要说,两个表格数据差不多, 直接合并数据导出就行: async function getDa ...

  9. PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档

    PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档 >>>>>>>>>>>& ...

随机推荐

  1. javascript--判断语句

    1.if...else.. if(m===1){ console.log('1') }else{ console.log('X') } 一般if 里面采用类型全等的运算符. 2.switch var ...

  2. tp5 查询本年、本月、本周的方法

    tp5自带了一些查询的方法,今天说一下查询本年.本月以及本周的方法 whereTime()//此方法代替了between and 方法 实际用法如下: ->whereTime('时间字段','y ...

  3. 微信小程序--跳转页面常用的两种方法

    一.bindtap="onProductsItemTap"绑定点击跳转事件 在.wxml文件中绑定 在.js文件中实现绑定事件函数 二.navigator标签配合URL跳转法 在w ...

  4. hdu多校第五场1004 (hdu6627) equation 1 计算几何

    题意: 给你一个C,再给你n组a,b,让你求x取什么值的时候,$ \sum_{i=1}^n |a_i*x+b_i| =C $,要求求出解的个数,并用最简分数从小到大表示,如果有无穷多解,输出-1. 题 ...

  5. Spring-Security (补充)

    一.配置静态资源过滤 直接在xml中配置即可 <!-- 配置静态资源过滤 --> <security:http security="none" pattern=& ...

  6. Keystone controller.py & routers.py代码解析

    目录 目录 Keystone WSGI 实现 controllerspy routerspy 参考文档 Keystone WSGI 实现 Keystone 项目把每个功能都分到单独的目录下,EXAMP ...

  7. Delph i2010

    我在习惯Delphi2010 转载   一直留着一个txt文件,不晓得是干嘛的(忘记了),偶然打开一看.乖乖~ 2010 还可以这样玩. 1.循环有了新用法 procedure TForm1.Butt ...

  8. IK分词器 原理分析 源码解析

    IK分词器在是一款 基于词典和规则 的中文分词器.本文讲解的IK分词器是独立于elasticsearch.Lucene.solr,可以直接用在java代码中的部分.关于如何开发es分词插件,后续会有文 ...

  9. importError:cannot import name imsave/imread等模块

    首先要先看相应的库是否已经安裝成功 pip install numpy pip install pillow pip install scipy 都成功安装之后,执行: import scipy.mi ...

  10. 事务和JDBC事务隔离级别

    与事务相关的理论 mysql事物隔离级别:http://mj4d.iteye.com/blog/1744276 事务(Transaction): 是并发控制的单元,是用户定义的一个操作序列.这些操作要 ...