crystal reports 中subreport的问题 ( 积分: 50 )

  • 主题发起人 主题发起人 zhaoxuncai
  • 开始时间 开始时间
Z

zhaoxuncai

Unregistered / Unconfirmed
GUEST, unregistred user!
我用CRYSTAL REPORTS 10 设计报表,因设计需要在大报表中要套小报表,也就是subreport ,reports和subreport 的database field都设为sql 中所对应的的table
程式如下:
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select orders.*,paper.*,prints.*,process.*,packaging.* from orders inner join format on orders.order_no=format.order_no ');
adoquery2.SQL.Add('inner join paper on orders.order_no=paper.order_no inner join prints on orders.order_no=prints.order_no ');
adoquery2.SQL.Add('inner join process on orders.order_no=process.order_no inner join packaging on orders.order_no=packaging.order_no ');
adoquery2.SQL.Add('where orders.order_no='''+edit1.text+'''');
adoquery2.Open;
if opendialog1.execute then
begin
crpe1.Connect.Clear;
Crpe1.connect.ServerName:= 'mingtai-server';
Crpe1.connect.DatabaseName:= 'mingtai';
crpe1.Connect.UserID:= 'sa';
crpe1.connect.Password:= '';
crpe1.ReportName:=opendialog1.filename;
Crpe1.Connect.Propagate := True;
crpe1.DiscardSavedData;
try
crpeds1.dataset:=adoquery2;
crpe1.Tables[0].DataPointer:=crpeds1.datapointer;
screen.Cursor:=crhourglass;
// crpe1.ParamFields[0].ShowDialog := False;
// crpe1.ParamFields[0].CurrentValue := pubworkname;
crpe1.execute;
finally
screen.Cursor:=crdefault;
end;
end;
当我打印时,我只想我选择的工单出来,但在subreport中所有的数据资料都显示出来,包含我不需要的,而我已经crpe1.Tables[0].DataPointer:=crpeds1.datapointer 我并没有设save data with report
请问各位是为什么?
谢谢!
 
我用CRYSTAL REPORTS 10 设计报表,因设计需要在大报表中要套小报表,也就是subreport ,reports和subreport 的database field都设为sql 中所对应的的table
程式如下:
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select orders.*,paper.*,prints.*,process.*,packaging.* from orders inner join format on orders.order_no=format.order_no ');
adoquery2.SQL.Add('inner join paper on orders.order_no=paper.order_no inner join prints on orders.order_no=prints.order_no ');
adoquery2.SQL.Add('inner join process on orders.order_no=process.order_no inner join packaging on orders.order_no=packaging.order_no ');
adoquery2.SQL.Add('where orders.order_no='''+edit1.text+'''');
adoquery2.Open;
if opendialog1.execute then
begin
crpe1.Connect.Clear;
Crpe1.connect.ServerName:= 'mingtai-server';
Crpe1.connect.DatabaseName:= 'mingtai';
crpe1.Connect.UserID:= 'sa';
crpe1.connect.Password:= '';
crpe1.ReportName:=opendialog1.filename;
Crpe1.Connect.Propagate := True;
crpe1.DiscardSavedData;
try
crpeds1.dataset:=adoquery2;
crpe1.Tables[0].DataPointer:=crpeds1.datapointer;
screen.Cursor:=crhourglass;
// crpe1.ParamFields[0].ShowDialog := False;
// crpe1.ParamFields[0].CurrentValue := pubworkname;
crpe1.execute;
finally
screen.Cursor:=crdefault;
end;
end;
当我打印时,我只想我选择的工单出来,但在subreport中所有的数据资料都显示出来,包含我不需要的,而我已经crpe1.Tables[0].DataPointer:=crpeds1.datapointer 我并没有设save data with report
请问各位是为什么?
谢谢!
 
自顶一下
 
再顶一下
 
1、打开Crystal Report VCL 10安装后自带的DEMO,总是会得到以下提示,请问大虾们是什么原因?应该如何避免:
Error reading Crpe1.ExportOption.CharSepDelimiter:Property CharSepDelimiterdo
es not exist.Ignore the error and continue?NOTE:Ignoring the error may cause components to be deleted or property values to be lost.
2、当按F9执行时,又会弹出一个错误对话框,提示如下,是什么回事?应该如何修正使之正常?
Project TabControl.exe raised exception class ECrpeError with message 'Error:104 Failed to obtain Version Information from CRPE32.DLL-GetCrpeVersion<GetVerstionInfo>Windows Error Number:2-系统找不到指定的文件。'.Process stopped.Use Step or Run to continue.
3、本人最近在学习如何在Delphi(7)中使用Crystal Report,刚开始就有一些麻烦,请大虾们指点迷津!不胜感激。
 
后退
顶部