Delphi QuickReports:实现细节子标注的标注顺序?
我需要在Delphi 5中创建一个QuickReport,其布局如下:Delphi QuickReports:实现细节子标注的标注顺序?,delphi,reporting,delphi-5,quickreports,Delphi,Reporting,Delphi 5,Quickreports,我需要在Delphi 5中创建一个QuickReport,其布局如下: +================ | Report Header +================ +========================================= | Detail Band (auto-stretching, repeats) . +========================================= | Child band (fixed-size)
+================
| Report Header
+================
+=========================================
| Detail Band (auto-stretching, repeats)
.
+=========================================
| Child band (fixed-size)
+======================================
| Child band (Auto-stretching)
.
+======================================
| Child band (fixed-size)
+======================================
+=================================
| Report Footer (auto-stretching)
.
+=================================
+==================================
| Report Footer (auto-stretching)
.
+==================================
+=============================
| Report Footer (fixed size)
+=============================
有人能想出页眉、详细信息、子项、页脚、子详细信息、组页眉、组页脚标注栏的组合,以及它们之间关联的父项、主项、报告、查询链接,以便我可以制作一份需要的报告吗
不要混淆我对这些术语的用法
- 标题栏
- 细节带
- 儿童乐队
- 页脚带
- 整个报告(报告标题)开头的单个标注栏
- 由四个乐团组成的重复组
- 在所有细节之后出现的三个条带,前两个是自动拉伸条带
CREATE TABLE STRs (
StrID int,
Number text,
Date datetime,
Comments text,
DescriptionOfSuspiciousActivity text,
ActionTaken text,
EmployeeName text,
EmployeeTitle text,
EmployeeNumber text )
CREATE TABLE STRTransactions (
STRTranasctionID int,
STRID int,
BuyAmount money)
CREATE TABLE STRTransactionSells (
STRTransactionID int,
SellAmount money)
CREATE TABLE STRTransactionPatronInfo (
STRTransactionID int,
Name text,
Address text,
DOB text,
IDNumber text,
Occupation text )
CREATE TABLE STRTransactionThirdPartyInfo (
STRTransactionID int,
Name text,
Address text,
DOB text,
IDNumber text,
Occupation text )
CREATE TABLE OriginalTransactions (
STRTransactionID int,
BuyAmount money,
SellAmount money )
我失败的实验 我尝试创建一个具有以下乐队布局的QuackReport:
+=====================================================+
| PageHeader (TQRBand, BandType=rbPageHeader) |
+=====================================================+
+=====================================================+
| DetailBand (TQRBand, BandType=rbDetail) |
+===+=================================================+
| ChildBand1 (TQRChildBnad, Parent=DetailBand) |
! (autostretch) !
+===+=============================================+
| ChildBand2 (TQRChildBand, Parent=ChildBand1 |
+=============================================+
+=====================================================+
| ChildBand3 (TQRChildBand, Parent=(none) |
! (autostretch) !
+=====================================================+
| ChildBand4 (TQRChildBand, Parent=ChildBand3 |
! (autostretch) !
+=================================================+
+=====================================================+
| SummaryBand (TQRBand, BandType=rbSummary) |
+=====================================================+
注意:缩进用于帮助识别父子关系(即,波段实际上不是50像素的无向排列)
此设计的问题在于,在leat的设计时,摘要带出现在两个绞合子带之前:
+=====================================================+
| PageHeader (TQRBand, BandType=rbPageHeader) |
+=====================================================+
+=====================================================+
| DetailBand (TQRBand, BandType=rbDetail) |
+===+=================================================+
| ChildBand1 (TQRChildBnad, Parent=DetailBand) |
! (autostretch) !
+===+=============================================+
| ChildBand2 (TQRChildBand, Parent=ChildBand1 |
+=============================================+
+=====================================================+
| SummaryBand (TQRBand, BandType=rbSummary) |
+=====================================================+
+=====================================================+
| ChildBand3 (TQRChildBand, Parent=(none) |
! (autostretch) !
+=====================================================+
| ChildBand4 (TQRChildBand, Parent=ChildBand3 |
! (autostretch) !
+=================================================+
当报告运行时(在运行时),两个搁浅的子带甚至不会打印:
+=====================================================+
| PageHeader (TQRBand, BandType=rbPageHeader) |
+=====================================================+
+=====================================================+
| DetailBand (TQRBand, BandType=rbDetail) |
+===+=================================================+
| ChildBand1 (TQRChildBnad, Parent=DetailBand) |
! (autostretch) !
+===+=============================================+
| ChildBand2 (TQRChildBand, Parent=ChildBand1 |
+=============================================+
+=====================================================+
| SummaryBand (TQRBand, BandType=rbSummary) |
+=====================================================+
验证码:quackreports(请记住,我不再有QuickReports可用,所以这都是内存提供的)
好的。。。我以前遇到过这个问题。。。
给你一个完整的代码示例需要很长的时间(我根本没有时间),但我将尝试描述我的解决方案,以便你能理解它
不要使用TQRChildBand,而是使用all DetailBand。然后,您将挂起每个乐队的BeforePrint活动
您可以在BeforePrint事件中使用类似的内容:
printband := FPrintSubBandA;
使用一组通用变量(或报表窗体上的私有成员)定义报表上显示的给定记录应显示和不应显示的标注栏。。。。所有类型的布尔型(注意:您可以使用一组枚举,但布尔型更容易/更快地实现imho)
在NeedData事件中,您将推断给定记录需要哪些波段,并相应地设置这些变量(当然是布尔值)
整个解决方案是一个肮脏的黑客,但必不可少的,因为QuickReports对选择性记录上嵌套子带的支持基本上是不存在的
如果这还不够,请告诉我,我会仔细查看我的代码档案,看看我是否能找到一个这样做的例子。
从本质上说,这个问题正是我转而使用RaveReports的原因
编辑:
我猜想您很可能已经尝试在运行时设置每个子乐队的ParentBand值。。。如果你没有,不要浪费你的时间!这样做会导致更多的异常结果(我甚至尝试过访问冲突)我可能会感到困惑,但我认为我们需要更多关于您试图显示的数据的信息,以便正确回答这个问题。可能是一个简短的示例,其中显示了带有一些示例数据的数据库模式,或者是一个模拟示例,说明了在给定示例数据的情况下,报表应该是什么样子。三个小时撰写一个关于stuckoverflow的问题会占用客户的时间
printband := FPrintSubBandA;