如何在InfoMaker/Powerbuilder中显示底层库和表单的名称?

发布于 2024-12-25 02:42:56 字数 91 浏览 2 评论 0原文

我正在为报表运行 InfoMaker,并且希望在报表本身中显示基础表单和基础库的名称。有谁知道如何得到这个?我看到的最接近的是“描述”功能,但这似乎比我需要的更深一层。

I am running InfoMaker for reports, and would like to show the name of the underlying form and the underlying library in the report itself. Does anyone know how to get this? The closest thing I see is the Describe function, but that seems to work one level deeper than I need.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

溺孤伤于心 2025-01-01 02:42:56

如果您需要在设计时在 InfoMaker 中显示库名称,我不知道。

但是如果您需要在运行时显示库名称,我会在报告中添加一个计算字段,并从打开报告的代码中设置其表达式。

类似 dw.modify("c_lib.expression='" + classname() + "'") 的内容,其中 c_lib 是该计算字段的名称。警告,不要从全局函数内部调用 classname(),因为它会使 PB 崩溃...

If you need to display the library name in InfoMaker at design time, I have no idea.

But if you need to display the library name at run time, I would add a computed field in the report and set its expression from the code that opens the report.

Something like dw.modify("c_lib.expression='" + classname() + "'") where c_lib is the name of that computed field. Warning, do not call classname() from inside a global function, as it make PB crash...

迟到的我 2025-01-01 02:42:56

作为一种作弊,您可以对库进行硬编码并动态获取数据对象(您的报告不应更改曾经经常编写的库,大多数情况下不会这样做。),或者从列出它们的数据存储中获取它数据库中的一张表,将它们组织在一个地方。获取数据对象并在数据存储中搜索关联的库。你需要维护桌子,但这应该能让你下线......

As a cheat you can just hard-code the library and dynamically get the dataobject on the fly (your reports shouldn't change libraries once written too often, most never do.), or pick it up from a datastore that lists them out from a table in the database that keeps them organised in one place. take the dataobject and search the datastore for the associated library. you'll need to upkeep the table, but this should get you down the line...

流心雨 2025-01-01 02:42:56

如果您无权访问运行报告的代码,则必须将信息添加到报告本身。我将编写一个小程序,将每个数据窗口从库加载到数据窗口控件中,添加或更新包含所需信息的文本控件,并将数据窗口保存回库中。当程序更新文本时,它应该只更新控件的文本属性,而不是位置、带等。这样,您可以将其设置为在大多数报告以及您通过以下方式调整的任何报告的正确位置添加文本手将停留在您放置它们的位置。确保文本足够大以容纳最长的表单+库组合。您可以通过将文本添加到其中一份报告并查看导出的语法来获取创建文本所需的语法。为文本对象使用一个不会与报告中现有的任何内容冲突的名称 - 又长又难看的名称。

If you don't have access to the code that runs the reports you will have to add the information to the report itself. I would write a small program that loads each DataWindow from a library into a DataWindow control, adds or updates a text control that has the information you want, and saves the DataWindow back to the library. When the program updates the text it should only the text property of the control, not the position, band, etc. That way you can set it up to add the text in the right place for most of your reports, and any you adjust by hand will stay where you put them. Be sure to make the text big enough to hold the longest form + library combination. You can get the syntax you need to create the text by adding the text to one of the reports and looking at the exported syntax. Use a name for the text object that will not collide with anything existing in your reports - something long and ugly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文