祝愿大家身体健康!

 站点注册  找回密码
 站点注册

QQ登录

只需一步,快速开始

查看: 508|回复: 16

[待解决] 动态生成数据窗口,无法在编译后的程序中生成,求帮忙,谢谢大家!

[复制链接]

[待解决] 动态生成数据窗口,无法在编译后的程序中生成,求帮忙,谢谢大家!

[复制链接]
cr999

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-5-31 08:06:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?站点注册

×
我在开发状态,运行程序,自动生成了n个数据窗口,通过 libraryimport 函数保存在 某 pbl 中。 然后再通过复合数据窗口 将这个n个数据窗口一次性显示出来。 但是编译后pbd文件,是无法修改的。 导致此功能在编译后的程序中无法正常运行,请教大家 通过什么办法 能解决这个问题。 谢谢大家!
共享共进共赢Sharing And Win-win Results
SYBASEBBS - 免责申明1、欢迎访问“SYBASEBBS.COM”,本文内容及相关资源来源于网络,版权归版权方所有!本站原创内容版权归本站所有,请勿转载!
2、本文内容仅代表作者观点,不代表本站立场,作者自负,本站资源仅供学习研究,请勿非法使用,否则后果自负!请下载后24小时内删除!
3、本文内容,包括但不限于源码、文字、图片等,仅供参考。本站不对其安全性,正确性等作出保证。但本站会尽量审核会员发表的内容。
4、如本帖侵犯到任何版权问题,请立即告知本站 ,本站将及时删除并致以最深的歉意!客服邮箱:admin@sybasebbs.com
swimchen

主题

0

回帖

5034

积分

论坛元老

积分
5034
贡献
在线时间
小时
2024-5-31 19:05:11 | 显示全部楼层
非常简单,这个pbl不要编译成pbd,或者搞一个专门的pbl,程序每次载入这个pbl就可以了,你编译pbd肯定就没作用了
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-5-31 21:24:12 | 显示全部楼层
swimchen 发表于 2024-5-31 19:05
非常简单,这个pbl不要编译成pbd,或者搞一个专门的pbl,程序每次载入这个pbl就可以了,你编译pbd肯定就没 ...

谢谢回复,麻烦问一下,程序怎么样设置能载入这个pbl, 我用的是pb6.5 开发的。  
共享共进共赢Sharing And Win-win Results
swimchen

主题

0

回帖

5034

积分

论坛元老

积分
5034
贡献
在线时间
小时
2024-5-31 22:48:06 | 显示全部楼层
搞个叫dwSource.PBL,编译时不要选择,然后在程序运行时Load进来,每次从这个读取数据源,PB的DataWindow有个属性叫DataObject,支持路径的"C:\dwSource.PBL(d_SaleSummay)",不知道是不是,忘了,但是大致是对的,或者把你的报表另存为PSR文件,DataObject="C:\d_SaleSummary.PSR",也可以
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-6-1 09:12:33 | 显示全部楼层
swimchen 发表于 2024-5-31 22:48
搞个叫dwSource.PBL,编译时不要选择,然后在程序运行时Load进来,每次从这个读取数据源,PB的DataWindow有 ...

1、搞个叫dwSource.PBL,编译时不要选择,然后在程序运行时Load进来,

    程序运行时,怎么 load 进来,具体怎么操作啊?

2、  每次从这个读取数据源,PB的DataWindow有个属性叫DataObject,支持路径的"C:\dwSource.PBL(d_SaleSummay)",不知道是不是,忘了,但是大致是对的,

       试了一下好像不支持路径。

3、  或者把你的报表另存为PSR文件,DataObject="C:\d_SaleSummary.PSR",也可以

       PSR 保存的是报表的格式。 我现在调用的 多个数据窗口 还要其中的数据。


多谢回复!
共享共进共赢Sharing And Win-win Results
swimchen

主题

0

回帖

5034

积分

论坛元老

积分
5034
贡献
在线时间
小时
2024-6-1 20:01:16 | 显示全部楼层
第一点的处理方法:AddToLibraryList()添加PBD或者PBL,必须程序运行时使用,太久我忘光了,ORCA里面似乎也有API可以用,然后就是LibraryImport(),这个函数你看看,支持PBL的,原来我是用InfoMaker生成报表,放在PBL里面,PB程序读取这个PBL,用下面的办法可以是否添加了,注意不要同名
ClassDefinition cd_windef
String ls_libraries[ ]
ls_libraries[1] = "c:\libdir\windows.pbl"
ls_libraries[2] = "c:\libdir1\windows.pbl"
ls_libraries[3] = "c:\libdir2\ancestor.pbl"

cd_windef = FindClassDefinition("w_genapp_frame", ls_libraries)
If IsNull(cd_windef) Then
        MessageBox("Error", w_genapp_frame + " is not present in the present Library List!")
End If

第二点的做法是:你把动态生成的数据窗口写成两个文件,一个是Sytnax,dw_Data.Describe("Syntax"),保存到文本文件中,数据则是SaveAs()保存,然后要用到的时候,dw_Data.Create(Syntax),然后ImportFile()

第三点:PSR支持复合包表的,实在不行,用SetFullState()和GetFullState()
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-6-1 20:53:21 | 显示全部楼层
我用的 这个函数 SetLibraryList

Description

Changes the files in the library search path of the application.

Controls

Application object

Syntax

applicationname.SetLibraryList ( filelist )
Argument        Description
applicationname        The name of the application object for which you want to change the library search path
filelist        A comma-separated list of filenames. Specify the full filename with its extension. If you do not specify a path, PowerBuilder uses the system's search path to find the file
Return value
Integer. Returns 1 if it succeeds. If an error occurs, it returns:

-1  The application is being run from PowerBuilder, rather than from a        standalone executable.
-2  A currently instantiated object is in a library that is not on the new        list.

If any argument's value is NULL, SetLibraryList returns NULL.

Usage

When your application needs to load an object, PowerBuilder searches for the object first in the executable file and then in the dynamic libraries specified for the application. You can specify a different list of library files from those specified in the executable with SetLibraryList. Calling SetLibraryList replaces the list of library files specified in the executable with a new list of files. For example, you might use SetLibraryList to configure the library list for an application containing many subsystems.

SetLibraryList should only be called in your application's Open event script. Otherwise, it may cause your application to crash.

PowerBuilder cannot check whether the libraries you specify are appropriate for the application. It is up to you to make sure the libraries contain the objects that the application needs.

The executable file is always first in the library search path. If you include it in  filelist, it is ignored.

If you are running your application in the PowerBuilder development environment, this function has no effect.

不过编译后运行时,返回值是 -2 ,也没有找出原因是什么?

ll=finance.SetLibraryList("finance.pbd,aaa.pbd,temp.pbl)   这里面我加了个 temp.pbl,  然后我的思路是,

先动态生成全部数据窗口,估计有几十个,通过LibraryImport() 保存到 temp.pbl  这部分功能都能顺利实现,

现在就是 把这些数据窗口,动态生成 复合数据窗口 的过程中,编译后的程序无法读取到 temp.pbl 中的数据窗口。不知道

是不是因为SetLibraryList() 这个函数执行不成功的原因, 是不是里面不能添加 pbl, 不过我都改成 pbd, 还是出错,返回值 还
是 -2,  搞不懂是什么原因, 多谢您的回复!!!
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-6-1 20:55:23 | 显示全部楼层
-2  A currently instantiated object is in a library that is not on the new list.

这个错误提示,没太搞懂确切的意思是什么?
共享共进共赢Sharing And Win-win Results
swimchen

主题

0

回帖

5034

积分

论坛元老

积分
5034
贡献
在线时间
小时
2024-6-2 16:42:06 | 显示全部楼层
SetLibraryList只能在Application对象里面的事件调用
共享共进共赢Sharing And Win-win Results
swimchen

主题

0

回帖

5034

积分

论坛元老

积分
5034
贡献
在线时间
小时
2024-6-2 16:43:34 | 显示全部楼层
仔细看帮助,SetLibraryList()在9.0标注为废弃语法,要用AddToLibraryList ()
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-6-2 18:53:27 | 显示全部楼层
我用的 pb 6.5 ,  只有这个函数, 是在 Application 对象的 open 事件中 调用的
共享共进共赢Sharing And Win-win Results
cr999 楼主

主题

0

回帖

771

积分

高级会员

积分
771
贡献
在线时间
小时
2024-6-3 12:07:20 | 显示全部楼层
谢谢老师们,多多指点,看看怎么解决这个问题,我用的pb6.5,
共享共进共赢Sharing And Win-win Results
您需要登录后才可以回帖 登录 | 站点注册

本版积分规则

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com

QQ|Archiver|PowerBuilder(PB)BBS社区 ( 鲁ICP备2021027222号-1 )

GMT+8, 2024-6-18 22:10 , Processed in 0.086991 second(s), 8 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表