Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > 在嵌套数据窗口上使用GetChild()函数
【标  题】:在嵌套数据窗口上使用GetChild()函数
【关键字】:GetChild
【来  源】:http://blog.csdn.net/followdream/archive/2006/11/28/1418691.aspx

在嵌套数据窗口上使用GetChild()函数

Your Ad Here

 Using the GetChild() function on Nested DataWindows

From the PowerBuilder help files:

Getchild() provides a reference to
a child DataWindow or to a report in a composite DataWindow,
which you can use in DataWindow functions to manipulate that DataWindow or report.

According to the definition above,
a call to GetChild ( ) for the nested report that is part of
a tabular (or other) DataWindow fails and the function returns -1.
So there is no way you can get a reference to
the nested DataWindow that is part of a non-composite DataWindow.

The following method enables the usage of
the getChild() function also on such non-composite DataWindows.

1. Export your Tabular, Freeform, Grid, Graph ( or whatever )
   style base DataWindow in the library painter.
2. In the third line of the export file change "processing=0" (or whatever)
   to "processing=5". This is the actual trick ie. to impose
   the functionality of a composite DataWindow (it has processing=5).
3. Import the exported and modified file back.
4. You can call GetChild ( ) on your nested DataWindow as you "normally" would.

Now you have the power of the datawindowchild functions at hand,
which means you could easily modify nested reports
after the retrieve ie. Filtering and Sorting etc.

NOTICE:
The method described above is an undocumented
and NOT SUPPORTED by Sybase and should be used with caution.
--------------------------------------------------
在嵌套数据窗口上使用GetChild()函数

从PowerBuilder的帮助文件得知:
“GetChild()在复合数据窗口中提供一个对子数据窗口或者报表的引用,
你可以在数据窗口函数中使用这个引用来操作那个数据窗口或者报表。”

根据上面的定义,为Tabular(或其他)数据窗口中的嵌套报表调用GetChild()会失败并且函数返回-1。
所以你没有办法获得对非复合数据窗口中嵌套数据窗口的引用。

下面的方法使getChild()在这种非复合数据窗口上也能够使用:
1、在库画板中导出你的Tabular, Freeform, Grid, Graph (或者无论哪种)类型的数据窗口;
2、在所导出文件的第三行,把“processing=0” (或者无论是什么) 改成 “processing=5”。
   这是目前的诀窍,也就是把复合数据窗口(processing=5)的功能强加上去。
3、把导出并修改后的文件导入回去。
4、你可以在嵌套数据窗口中“正常地”调用GetChild()了。

现在,你手中拥有子数据窗口函数的权力了,这意味着你可以在提取也就是Filtering和Sorting等等之后很容易地修改嵌套报表了。

注意:
上面所描述的方法没有被Sysbase正式发布和支持,应该谨慎使用。

在Windows下编译sqlite3生成动态链接库并使用之:【上一篇】
re:请教高手们PostgreSQL里面NULL::varchar是什么意思?下面有详细整条语句~请高手们进来帮忙~:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • 多线程下的设计模式研究(一):原子对象模式
  • sed中文手册
  • 强大的轻量级网络入侵检测系统SNORT
  • BEA WebLogic Server8.1 JMS入门
  • JavaMail使用教程
  • SQL语言入门教程:第四课 向表格中添加、更新、删除记录
  • 再谈线程池的实现
  • 安全卸载 Windows 2000
  • 如何定制企业防火墙安全机制(1)
  • 水晶报表问题收集
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.