如何使ReportBuilder中的主/详细子报表正确显示?
我在 ReportBuilder 中有一份报告,应该报告两个对象。我没有创建此报告,我也无法向创建此报告的人询问其工作原理。在运行报表之前,我们需要执行一些代码,查找对象的所有属性,并将它们加载到内存数据集中,如下所示:
OBJECT_ID: TStringField
PROP_NAME: TStringField
PROP_VALUE: TStringField
然后,报表引擎在报表上为此数据集中的每个属性创建一行。这是在子报告中实现的,其父报告仅包含 OBJECT_ID,这是一个人类可读的名称。
一切都很顺利,直到我们不得不在报告中显示任意大小的“评论”。我使用 TMemoField 制作了第二个子报告,以便它可以保存文本,并在报告设计器中设置报告。
当我运行报告时,我所期望的结果是这样的:
HEADER
Object 1 properties
Object 1 comment
Object 2 properties
Object 2 comment
我已经设法获得了几乎所有内容,但是。我使用子报告管道的 MasterDataPipeline 和 MasterFieldLinks 属性来尝试将子报告的 OBJECT_ID 链接到标题的 OBJECT_ID,这是我设法达到的最接近的结果,但现在我看到的是
HEADER
Object 1 properties
Object 1 comment
Object 2 comment
:尽管我已手动验证数据是否正确进入数据集,但“对象 2 属性”部分却无处可见。
这让我抓狂。任何 ReportBuilder 专家都知道发生了什么事,现在要解决它吗?
I've got a report in ReportBuilder that's supposed to report on two objects. I didn't create this report, and I can't ask the person who did about how it works. Before running the report, we have some code that goes through, finds all the properties on the objects, and loads them into a memory dataset that looks like this:
OBJECT_ID: TStringField
PROP_NAME: TStringField
PROP_VALUE: TStringField
The report engine then creates a line on the report for each property in this dataset. This is implemented in a sub-report, whose parent only contains an OBJECT_ID, which is a human-readable name.
Everything was going great until we had to display a "comment" of arbitrary size in the report. I made a second sub-report with a TMemoField so it could hold the text, and set the report up in the report designer.
What I expect when I run the report is something that looks like this:
HEADER
Object 1 properties
Object 1 comment
Object 2 properties
Object 2 comment
I've managed to get just about everything but that. I used the MasterDataPipeline and MasterFieldLinks properties of the sub-report's pipelines to try to link the OBJECT_IDs of the sub-reports to the OBJECT_ID of the header, and that's the closest I've managed to come, but now what I see is:
HEADER
Object 1 properties
Object 1 comment
Object 2 comment
The "Object 2 properties" section is nowhere to be seen, even though I've manually verified that the data is making it into the dataset correctly.
This is driving me nuts. Any ReportBuilder gurus out there know what's going on and now to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您做得对,但主从链接必须在数据集中(即 TTable、TClentDataSet)而不是管道中设置。
请参阅 RBuilder PDF 手册第 291 页(可在 Digital Metaphors 网站上找到)。
You've done it right, but the master-detail link must be set in the datasets (i.e. TTable, TClentDataSet) instead of pipelines.
See page 291 of RBuilder PDF manual (can be found on Digital Metaphors web-site).