判断该DataWindow的数据源和显示风格

fanjinchang 2009-06-06 05:49:42
请教各位高手,大家都该知道,在创建数据窗口对象的时候会选择数据源和显示风格。反过来要是有一个DataWindow的话,怎么才能判断该DataWindow的数据源和显示风格呀?急.............
...全文
91 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
talenter 2009-06-19
  • 打赏
  • 举报
回复
打开数据窗口的数据源,里面有你要的信息
Mr_Nice 2009-06-19
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lzp_lrp 的回复:]
引用楼主 fanjinchang 的帖子:
请教各位高手,大家都该知道,在创建数据窗口对象的时候会选择数据源和显示风格。反过来要是有一个DataWindow的话,怎么才能判断该DataWindow的数据源和显示风格呀?急.............



数据源可以用

string ls_sql

ls_sql = dw_1.describe("datawindow.table")

或者

ls_sql = dw_1.getsqlselect()

数据窗口的显示风格
string setting

setting = dw1.Object.DataW…
[/Quote]
学习了,不错不错!
singsongs 2009-06-08
  • 打赏
  • 举报
回复
学习了。
WorldMobile 2009-06-06
  • 打赏
  • 举报
回复
[Quote=引用楼主 fanjinchang 的帖子:]
请教各位高手,大家都该知道,在创建数据窗口对象的时候会选择数据源和显示风格。反过来要是有一个DataWindow的话,怎么才能判断该DataWindow的数据源和显示风格呀?急.............
[/Quote]

数据源可以用

string ls_sql

ls_sql = dw_1.describe("datawindow.table")

或者

ls_sql = dw_1.getsqlselect()

数据窗口的显示风格
string setting

setting = dw1.Object.DataWindow.Processing
或者
setting = dw1.Describe("DataWindow.Processing")

以下pb中的帮助

Description

The type of processing required to display the data in the selected presentation style.

Controls

DataWindows

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Processing

Describe argument:

"DataWindow.Processing"

Return values are:

0 - (Default) Form, group, n-up, or tabular
1 - Grid
2 - Label
3 - Graph
4 - Crosstab
5 - Composite
6 - OLE
7 - RichText
8 - TreeView
9 - TreeView with Grid
newease 2009-06-06
  • 打赏
  • 举报
回复
显示风格

string setting

setting = dw_1.Object.DataWindow.Processing

指明数据窗口对象的表现风格 有效取值为
0——缺省值 表现风格为 Form group query 或 tabular
1——Grid
2—— Label
3—— Graph
4 ——Crosstab
5——Composite
newease 2009-06-06
  • 打赏
  • 举报
回复
GetSQLSelect()
功能 返回数据窗口控件当前使用的SELECT 语句 当数据窗口对象的数据源是访问
SQL数据库的数据源时 比如数据源为SQL Select, Quick Select或 Query
语法 dwcontrol.GetSQLSelect ( )
参数 dwcontrol 数据窗口控件名
返回值 String 函数执行成功时返回数据窗口控件dwcontrol当前使用的SQL SELECT
语句 如果不能返回 SQL SELECT 语句 则 GetSQLSelect()函数返回空字符串 "" 如
果dwcontrol的值为 NULL 则 GetSQLSelect()函数返回 NULL

string old_select, new_select, where_clause

old_select = dw_emp.GetSQLSelect()
where_clause = ... //要添加的SELECT语句条件
// 把新的WHERE子句条件添加到原来的SELECT语句
new_select = old_select + where_clause
dw_emp.SetSQLSelect(new_select)

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧