powerdesigner怎么导出到excel 博客园

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powerdesigner怎么导出到excel 博客园相关的知识,希望对你有一定的参考价值。

1. 编写测试excel文件
2. 打开pd脚本编辑器
PD菜单栏中,依次点击“Tools ->Excute Commands->Edit/Run Script..”
3. 编写脚本
\' Open & Create Excel Document Dim x1 \'
Set x1 = CreateObject("Excel.Application") x1.Workbooks.Open "D:/荷露叮咚.xlsx" x1.Workbooks(1).Worksheets("Sheet1").Activate Else
HaveExcel = False End If
a x1, mdl
sub a(x1, mdl) dim rwIndex dim tableName dim colname dim table dim col dim count
\'on error Resume Next For rwIndex = 1 To 4 step 1
With x1.Workbooks(1).Worksheets("Sheet1")
\'MsgBox "生成数据表结构共计1 ="+CStr(.Cells(2,2).Value ), vbOK + vbInformation, "表" If .Cells(rwIndex, 1).Value = "" Then Exit For End If
If .Cells(rwIndex, 3).Value = "" Then set table = mdl.Tables.CreateNew table.Name = .Cells(rwIndex , 1).Value table.Code = .Cells(rwIndex , 2).Value count = count + 1 Else
colName = .Cells(rwIndex, 1).Value set col = table.Columns.CreateNew
\'MsgBox .Cells(rwIndex, 1).Value, vbOK + vbInformation, "列" col.Name = .Cells(rwIndex, 1).Value
\'MsgBox col.Name, vbOK + vbInformation, "列" col.Code = .Cells(rwIndex, 2).Value
col.Comment = .Cells(rwIndex,1).Value col.DataType = .Cells(rwIndex, 3).Value
4. 测试
第一步:把excel模板文件(例如荷露叮咚.xlsx)拷贝到 D盘根目录下(这里的路径需与脚本中标红的地方匹配。)
第二步:运行脚本
第三步:检查导入效果
参考技术A 琢磨了一下,单表导出execl很简单,双击打开表定义,在columns下,有execl导出,然后在execl中加边框即可,相同操作另外一张表时,保持execl文件到第一次的execl中,选append方式。依次可实现powerdesigner中物理模型导出到execl中,觉得本人方法有些麻烦,但也算是解决问题。本回答被提问者和网友采纳

以上是关于powerdesigner怎么导出到excel 博客园的主要内容,如果未能解决你的问题,请参考以下文章

PowerDesigner数据库设计导出到Excel

PowerDesigner导出excel按表名排序

如何把PowerDesigner 8的表设计导到EXCEL中

如何把powerdesigner 设计的表格导出到excel

PowerDesigner导出数据表结构到Excel 所有表结构在同一个Sheet中

PowerDesigner 中模型设计导出Excel表格