'******************************************************************************
'* 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. 1.MySQL基础架构

    好久没发博客了,终于又学完了一点知识并且进行了整理.就从这个MySQL系列开始继续坚持每个月产出几篇. 声明一下,这次的MySQL系列是针对已有一定基础的小伙伴的,关于SQL的使用,一些概念的介绍就不 ...

  2. C# Selenium

    ChromeOptions option = new ChromeOptions(); option.AddArgument("disable-extensions"); opti ...

  3. vscode编程nodejs初始安装

    nodejs官网 http://nodejs.cn/ 1.安装nodejs,记得安装时勾选配置路径 在cmd中输入node,进去node环境即为安装成功. 2.安装vscode,并安装插件node e ...

  4. PHPExcel导出数据量过大处理

    今天使用PHPExce插件导不出数据,发现是数据量过大的原因,这里只做简单的处理. 1.导出超时处理:在执行页面添加:set_time_limit(0); 2.内存溢出:在执行页面添加:ini_set ...

  5. 牛客多校第八场 C CDMA 线性代数:沃尔什矩阵

    题意: 构造出一个由1和-1组成的$2^k*2^k$的矩阵,使得矩阵任意两列内积为0 题解: 数学知识,沃尔什矩阵.沃尔什矩阵的特性被CDMA(码分多址)采用,使得编码成为无线信号的频段和振幅之外的第 ...

  6. D语言简介

    D语言,一种通用计算机程序语言,威力强大.功能丰富,支持多种编程范式,例如面向对象.[1]  D语言最初由Digital Mars公司就职的Walter Bright于2001年发布,意图改进C++语 ...

  7. 使用 Lookaside List 分配内存

    1. 概述 windows 提供了一种基于 lookaside list 的快速内存分配方案,区别于一般的使用 ExAllocatePoolWithTag() 系列函数的内存分配方式.每次从 look ...

  8. 剑指offer——26树的子结构

    题目描述 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一个树的子结构)   题解: 注意,所谓的子结构,是树的形状和值相同,并非判断B是不是A的一部分[如果是这样,那就是 ...

  9. 往github上上传项目

    点击start a project 新建 下面部分传送http://blog.csdn.net/s740556472/article/details/55000019 如图: 这里我们有一个步骤需要做 ...

  10. JQuery AJAX 通过一般处理程序 取列表

    由于上一篇的积累 这一个就简单了 也就是把反回了字符串 显示到table中 $("#btnSearch").click(function () { $.post("Cur ...