PowerDesigner导出所有表到Excel(同一表格)
'******************************************************************************
'* 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(同一表格)的更多相关文章
- 关于PowerDesigner导出数据库表到word文档
关于PowerDesigner导出数据库表到word文档 一.查看全部模板: powerdesigner默觉得我们提供了非常多的模版,在工具栏中选择[Report(报告)--->Report T ...
- PowerDesigner导出word表结构
一.wordTemplate.rtp下载 首先下载wordTemplate.rtp,将该文件放在一下路径下 C:\Program Files (x86)\Sybase\PowerDesigner 16 ...
- PowerDesigner导出建表sql脚本
1 按照数据库类型,切换数据库. Database-> Change Current DBMS... 2.设置保存路径和文件名称
- PHP用PHPExcel导出有多个工作表的Excel表格(thinkPHP3.2.3)
直接上代码: //导出excel public function excel() { //引入相关文件 import("Org.Util.PHPExcel"); import(&q ...
- PowerDesigner数据库设计PDM基于Excel的导入导出总结
经常用到pdm来管理代码,一两张表,手写一下还凑合,一旦表多了,就慌了.于是,开始学习用vbs进行Excel的来快速导入导出操作PDM就变得很紧急了,搜罗了网络上的很多vbs脚本,各有各的优点,但对于 ...
- Powerdesigner 导出Excel格式数据字典 导出Excel格式文件
版权声明:本文为博主原创文章,转载请注明出处; 网上我也看到了很多的Powerdesigner 导出方法,因为Powerdesigner 提供了部分VBA功能,所以让我用代码导出Excel格式文件得以 ...
- 导出----用Excel导出数据库表
根据条件导出表格: 前端 <el-form-item label=""> <el-button type="warning" icon=&qu ...
- vue多个数据不一样的表格导出到同一张excel里面
刚来公司第二天, 甩了个需求, 把两个不同表格的数据 导出到同一个excel中 ........额,好吧 你要说,两个表格数据差不多, 直接合并数据导出就行: async function getDa ...
- PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档
PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档 >>>>>>>>>>>& ...
随机推荐
- Ruby 安装 – Windows
Ruby 安装 – Windows 下面列出了在 Windows 机器上安装 Ruby 的步骤. 注意:在安装时,您可能有不同的可用版本. - Window 系统下,我们可以使用 RubyInstal ...
- bzoj1001题解
[解题思路] 显然,这题的答案是这个网格图的最小割.根据最大流-最小割定理,我们可以用网络流算法来求其最小割,时间复杂度最小为O(V2√E). 特殊的,这个网格图是一个平面图,于是可以根据平面图最小割 ...
- 禁用NX软件启动欢迎界面[转载]
环境变量UGII_BACKGROUND_URL NONE 转载自https://www.ugnx.net/wt/414
- sqlalchemy session
Cookie cookie是浏览器保存在用户电脑上的一小段文本,用来保存用户在网站上的必要的信息.Web页面或服务器告诉浏览器按照一定的规范存储这些信息,并且在以后的所有请求中,这些信息就会自动加在h ...
- oracle11g 导出表报EXP-00011:table不存在。
oracle11g 导出表报EXP-00011:table不存在. oracle11g,在用exp命令备份数据库时,如果表中没有数据报EXP-00011错误,对应的表不存在.这导致对应的空表无法备份. ...
- UVA 12676 Inverting Huffman
题目链接:https://vjudge.net/problem/UVA-12676 题目大意 一串文本中包含 N 个不同字母,经过哈夫曼编码后,得到这 N 个字母的相应编码长度,求文本的最短可能长度. ...
- 『BASH』——Learn BashScript from Daniel Robbins——[001-002]
ABSTRACT: Daniel Robbins is best known as the creator of Gentoo Linux and author of many IBM develop ...
- 什么是PoE、PSE、PD设备?
一个完整的PoE系统包括供电端设备(PSE, Power Sourcing Equipment)和受电端设备(PD, Power Device)两部分.PSE设备是为以太网客户端设备供电的设备,同时也 ...
- spark SQL之Catalog API使用
Catalog API简介 Spark中的DataSet和Dataframe API支持结构化分析.结构化分析的一个重要的方面是管理元数据.这些元数据可能是一些临时元数据(比如临时表).SQLCont ...
- IntelliJ IDEA无法创建springboot项目解决办法
最佳解决办法:IntelliJ IDEA---右键---以管理员身份运行. 方法二: 1.打开控制面板--系统和安全--windows防火墙 2.找到自己的默认浏览器,打勾,这里是谷歌浏览器 3.打开 ...