300分求助生成这样的报表!(300分)

  • 主题发起人 主题发起人 kadi88
  • 开始时间 开始时间
K

kadi88

Unregistered / Unconfirmed
GUEST, unregistred user!
ACCESS中有两个主从关系的表:客户资料表和接触记录表;
用客户ID相连系。客户ID是唯一的,接触ID可很多。
我想用reportmachine生成这样的报表:
客户ID 小区 楼层 房号
接触ID 接触时间 接触方式 接触内容
. 接触时间 接触方式 接触内容
. 接触时间 接触方式 接触内容
. . . .
客户ID 小区 楼层 房号
接触ID 接触时间 接触方式 接触内容
. 接触时间 接触方式 接触内容
. 接触时间 接触方式 接触内容
. . . .
这些数据不分页的“连续”生成下去,该怎么做给个方法行吗?
 
这个答案我也想知道!!
实现好象很困难!(用 QUICKREPORT )
 
分不够可加,谁肯出手相助!
 
其实我已解决了部分问题见:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1492797
可是一直不知道如何解决“连续”生成报表的问题!
 
用QReport倒是好做。
--------------------------
PageHeader
--------------------------
GroupHeader 客户资料表
--------------------------
Detail 接触记录表
--------------------------
GroupFooter 作些统计或空行
--------------------------
把GroupHeader和 Detail link起来
GroupHeader的Expression设为:客户资料表.客户ID
 
保证GroupHeader的ForceNewPage为False就可以一直打印下去。
ForceNewColumn为False
 
delphiland说的试过可是不行啊!
 
你的MAIL多少?我试一下再把例子发给你。
 
我试过可以呀。你的MAIL多少?
 
算了,帖在这儿吧
dfm:
object QuickReport2: TQuickReport2
Left = 0
Top = 0
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AfterPreview = QuickRepAfterPreview
DataSet = Query1
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
#39#39)
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = Auto
PrintIfEmpty = True
SnapToGrid = True
Units = Native
Zoom = 100
object QRBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 33
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = True
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
87.3125
1899.70833333333)
BandType = rbPageHeader
object QRLabel1: TQRLabel
Left = 184
Top = 6
Width = 368
Height = 22
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
58.2083333333333
486.833333333333
15.875
973.666666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = '使用DBDEMOS的Orders与Customer表'
Color = clWhite
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = '楷体_GB2312'
Font.Style = [fsBold]
ParentFont = False
Transparent = False
WordWrap = True
FontSize = 16
end
end
object QRGroup1: TQRGroup
Left = 38
Top = 71
Width = 718
Height = 24
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
LinkBand = QRBand2
Size.Values = (
63.5
1899.70833333333)
Expression = 'Query1.CustNo_1'
FooterBand = QRBand3
Master = Owner
ReprintOnNewPage = False
object QRDBText1: TQRDBText
Left = 112
Top = 8
Width = 49
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
296.333333333333
21.1666666666667
129.645833333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Query1
DataField = 'CustNo_1'
Transparent = False
WordWrap = True
FontSize = 9
end
object QRDBText4: TQRDBText
Left = 176
Top = 8
Width = 43
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
465.666666666667
21.1666666666667
113.770833333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Query1
DataField = 'Company'
Transparent = False
WordWrap = True
FontSize = 9
end
object QRLabel2: TQRLabel
Left = 16
Top = 8
Width = 85
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
42.3333333333333
21.1666666666667
224.895833333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = '客户编号、公司'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 9
end
end
object QRBand2: TQRBand
Left = 38
Top = 95
Width = 718
Height = 26
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
68.7916666666667
1899.70833333333)
BandType = rbDetail
object QRDBText2: TQRDBText
Left = 176
Top = 8
Width = 43
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
465.666666666667
21.1666666666667
113.770833333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Query1
DataField = 'OrderNo'
Transparent = False
WordWrap = True
FontSize = 9
end
object QRDBText3: TQRDBText
Left = 280
Top = 8
Width = 61
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
740.833333333333
21.1666666666667
161.395833333333)
Alignment = taRightJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Query1
DataField = 'ItemsTotal'
Transparent = False
WordWrap = True
FontSize = 9
end
end
object QRBand3: TQRBand
Left = 38
Top = 121
Width = 718
Height = 24
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
63.5
1899.70833333333)
BandType = rbGroupFooter
object QRLabel3: TQRLabel
Left = 154
Top = 6
Width = 37
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
407.458333333333
15.875
97.8958333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = '总计:'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 9
end
object QRExpr1: TQRExpr
Left = 208
Top = 6
Width = 133
Height = 13
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
34.3958333333333
550.333333333333
15.875
351.895833333333)
Alignment = taRightJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
ResetAfterPrint = True
Transparent = False
WordWrap = True
Expression = 'SUM(Query1.ItemsTotal)'
Mask = '¥#,##0.00'
FontSize = 9
end
end
object Query1: TQuery
Active = True
DatabaseName = 'DBDEMOS'
SQL.Strings = (
'SELECT ORDERS.* , CUSTOMER.* FROM ORDERS , CUSTOMER'
'WHERE ORDERS.CUSTNO=CUSTOMER.CUSTNO'
'ORDER BY CUSTNO')
Left = 16
Top = 8
object Query1OrderNo: TFloatField
FieldName = 'OrderNo'
Origin = 'DBDEMOS."ORDERS.DB".OrderNo'
DisplayFormat = #39'#'#39'0000'
end
object Query1CustNo: TFloatField
Alignment = taLeftJustify
CustomConstraint = 'CustNo IS NOT NULL'
ConstraintErrorMessage = 'CustNo cannot be blank'
FieldName = 'CustNo'
Origin = 'DBDEMOS."ORDERS.DB".CustNo'
DisplayFormat = 'CN 0000'
MaxValue = 9999
MinValue = 1000
end
object Query1SaleDate: TDateTimeField
FieldName = 'SaleDate'
Origin = 'DBDEMOS."ORDERS.DB".SaleDate'
end
object Query1ShipDate: TDateTimeField
FieldName = 'ShipDate'
Origin = 'DBDEMOS."ORDERS.DB".ShipDate'
end
object Query1EmpNo: TIntegerField
CustomConstraint = 'Value > 0'
ConstraintErrorMessage = 'EmpNo cannot be 0 or negative'
FieldName = 'EmpNo'
Origin = 'DBDEMOS."ORDERS.DB".EmpNo'
DisplayFormat = 'Emp'#39'#'#39' 0000'
MaxValue = 9999
MinValue = 1
end
object Query1ShipToContact: TStringField
FieldName = 'ShipToContact'
Origin = 'DBDEMOS."ORDERS.DB".ShipToContact'
end
object Query1ShipToAddr1: TStringField
FieldName = 'ShipToAddr1'
Origin = 'DBDEMOS."ORDERS.DB".ShipToAddr1'
Size = 30
end
object Query1ShipToAddr2: TStringField
FieldName = 'ShipToAddr2'
Origin = 'DBDEMOS."ORDERS.DB".ShipToAddr2'
Size = 30
end
object Query1ShipToCity: TStringField
FieldName = 'ShipToCity'
Origin = 'DBDEMOS."ORDERS.DB".ShipToCity'
Size = 15
end
object Query1ShipToState: TStringField
FieldName = 'ShipToState'
Origin = 'DBDEMOS."ORDERS.DB".ShipToState'
end
object Query1ShipToZip: TStringField
FieldName = 'ShipToZip'
Origin = 'DBDEMOS."ORDERS.DB".ShipToZip'
Size = 10
end
object Query1ShipToCountry: TStringField
FieldName = 'ShipToCountry'
Origin = 'DBDEMOS."ORDERS.DB".ShipToCountry'
end
object Query1ShipToPhone: TStringField
FieldName = 'ShipToPhone'
Origin = 'DBDEMOS."ORDERS.DB".ShipToPhone'
Size = 15
end
object Query1ShipVIA: TStringField
FieldName = 'ShipVIA'
Origin = 'DBDEMOS."ORDERS.DB".ShipVIA'
Size = 7
end
object Query1PO: TStringField
FieldName = 'PO'
Origin = 'DBDEMOS."ORDERS.DB".PO'
Size = 15
end
object Query1Terms: TStringField
FieldName = 'Terms'
Origin = 'DBDEMOS."ORDERS.DB".Terms'
Size = 6
end
object Query1PaymentMethod: TStringField
FieldName = 'PaymentMethod'
Origin = 'DBDEMOS."ORDERS.DB".PaymentMethod'
Size = 7
end
object Query1ItemsTotal: TCurrencyField
FieldName = 'ItemsTotal'
Origin = 'DBDEMOS."ORDERS.DB".ItemsTotal'
end
object Query1TaxRate: TFloatField
FieldName = 'TaxRate'
Origin = 'DBDEMOS."ORDERS.DB".TaxRate'
DisplayFormat = '0.00%'
MaxValue = 100
end
object Query1Freight: TCurrencyField
FieldName = 'Freight'
Origin = 'DBDEMOS."ORDERS.DB".Freight'
end
object Query1AmountPaid: TCurrencyField
FieldName = 'AmountPaid'
Origin = 'DBDEMOS."ORDERS.DB".AmountPaid'
end
object Query1CustNo_1: TFloatField
Alignment = taLeftJustify
CustomConstraint = 'CustNo IS NOT NULL'
ConstraintErrorMessage = 'CustNo cannot be blank'
FieldName = 'CustNo_1'
Origin = 'DBDEMOS."customer.DB".CustNo'
DisplayFormat = 'CN 0000'
MaxValue = 9999
MinValue = 1000
end
object Query1Company: TStringField
CustomConstraint = 'X IS NOT NULL'
ConstraintErrorMessage = 'Company Field has to have a value'
FieldName = 'Company'
Origin = 'DBDEMOS."customer.DB".Company'
Size = 30
end
object Query1Addr1: TStringField
FieldName = 'Addr1'
Origin = 'DBDEMOS."customer.DB".Addr1'
Size = 30
end
object Query1Addr2: TStringField
FieldName = 'Addr2'
Origin = 'DBDEMOS."customer.DB".Addr2'
Size = 30
end
object Query1City: TStringField
FieldName = 'City'
Origin = 'DBDEMOS."customer.DB".City'
Size = 15
end
object Query1State: TStringField
FieldName = 'State'
Origin = 'DBDEMOS."customer.DB".State'
end
object Query1Zip: TStringField
FieldName = 'Zip'
Origin = 'DBDEMOS."customer.DB".Zip'
Size = 10
end
object Query1Country: TStringField
FieldName = 'Country'
Origin = 'DBDEMOS."customer.DB".Country'
end
object Query1Phone: TStringField
FieldName = 'Phone'
Origin = 'DBDEMOS."customer.DB".Phone'
Size = 15
end
object Query1FAX: TStringField
FieldName = 'FAX'
Origin = 'DBDEMOS."customer.DB".FAX'
Size = 15
end
object Query1TaxRate_1: TFloatField
FieldName = 'TaxRate_1'
Origin = 'DBDEMOS."customer.DB".TaxRate'
DisplayFormat = '0.00%'
MaxValue = 100
end
object Query1Contact: TStringField
FieldName = 'Contact'
Origin = 'DBDEMOS."customer.DB".Contact'
end
object Query1LastInvoiceDate: TDateTimeField
FieldName = 'LastInvoiceDate'
Origin = 'DBDEMOS."customer.DB".LastInvoiceDate'
end
end
end
==============================================================================
Pas:
unit Unit2;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, DBTables;
type
TQuickReport2 = class(TQuickRep)
QRBand1: TQRBand;
QRGroup1: TQRGroup;
QRBand2: TQRBand;
QRBand3: TQRBand;
QRLabel1: TQRLabel;
Query1: TQuery;
QRDBText1: TQRDBText;
Query1OrderNo: TFloatField;
Query1CustNo: TFloatField;
Query1SaleDate: TDateTimeField;
Query1ShipDate: TDateTimeField;
Query1EmpNo: TIntegerField;
Query1ShipToContact: TStringField;
Query1ShipToAddr1: TStringField;
Query1ShipToAddr2: TStringField;
Query1ShipToCity: TStringField;
Query1ShipToState: TStringField;
Query1ShipToZip: TStringField;
Query1ShipToCountry: TStringField;
Query1ShipToPhone: TStringField;
Query1ShipVIA: TStringField;
Query1PO: TStringField;
Query1Terms: TStringField;
Query1PaymentMethod: TStringField;
Query1ItemsTotal: TCurrencyField;
Query1TaxRate: TFloatField;
Query1Freight: TCurrencyField;
Query1AmountPaid: TCurrencyField;
Query1CustNo_1: TFloatField;
Query1Company: TStringField;
Query1Addr1: TStringField;
Query1Addr2: TStringField;
Query1City: TStringField;
Query1State: TStringField;
Query1Zip: TStringField;
Query1Country: TStringField;
Query1Phone: TStringField;
Query1FAX: TStringField;
Query1TaxRate_1: TFloatField;
Query1Contact: TStringField;
Query1LastInvoiceDate: TDateTimeField;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRExpr1: TQRExpr;
procedure QuickRepAfterPreview(Sender: TObject);
private
public
end;

var
QuickReport2: TQuickReport2;
implementation
{$R *.DFM}
procedure TQuickReport2.QuickRepAfterPreview(Sender: TObject);
begin
Free;
end;

end.
 
我下载了一个 reportmachine 可是安装的时候提示没有DBGridEh文件,
请问哪里有更好的下载啊!
再帮忙看一下这个好吗?
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1524101
 
谢过delphiland,好些天未上网了试过后可以的话
分肯定给你!
 
RM处理这个问题很简单的呀!
细项数据
DetailDate1.OnBeforePrint
begin
if [ADODataSet2."ID"]<>[ADODataSet1."ID"] then
visible:=false else
visible:=true;
end
 
使用crystal report里的嵌套报表可以很容易解决这个问题。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部