[英]QuickReport: keep Details Band and Child Band on one page
Environment: Delphi 2010, QuickReport 5.0.5环境:Delphi 2010,QuickReport 5.0.5
I have a report with 2 bands: Detail band and it's Child band.我有一个包含 2 个乐队的报告:详细乐队和子乐队。 Problem is sometimes they are splitted on different pages.问题是有时它们被拆分在不同的页面上。
I would like to have detail band as a header for child and keep them on the same page always.我想将细节带作为儿童的 header 并始终将它们保持在同一页面上。
After some hours of studying I gave up.经过几个小时的学习,我放弃了。
UPDATE: The problem was in dynamically changed height of the child band.更新:问题在于子带的动态变化高度。 I solved it with analyzing of the height and ForceNewPage property.我通过分析高度和 ForceNewPage 属性解决了这个问题。
Does anybody know a solution?有人知道解决方案吗?
Try using the detail band's LinkBand property.尝试使用细节带的 LinkBand 属性。
If the child changes its size, you must calculate it on the parent's BeforePrint event.如果孩子改变了它的大小,你必须在父母的 BeforePrint 事件上计算它。
I think, bug is in the TQRCustomBand.StretchHeight
method.我认为,错误在TQRCustomBand.StretchHeight
方法中。 There are mixed size in units and in pixels:单位和像素有混合大小:
function TQRCustomBand.StretchHeight(IncludeNext : Boolean): extended;
begin
Result := Size.Length;
if Assigned(FLinkBand) and IncludeNext then
Result := Result + LinkBand.StretchHeight(True) + LinkBand.Height;
end;
I think, this is ordinary mistake and last part ( + LinkBand.Height
) will be removed.我认为,这是一个普通的错误,最后一部分( + LinkBand.Height
)将被删除。 But without source code (so only most expensive version) and recompile can't do this.但是没有源代码(所以只有最昂贵的版本)和重新编译不能做到这一点。 This bug stay from version 3 and still exists in 6.此错误保留在版本 3 中,并且仍然存在于 6 中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.