我现在只做了一张fastReport报表,现在其它单元要调用。 怎么调用?能不能做成一个函数,供其它单元调用,放在Public.Pas里边请列下具体代码,谢谢。
解决方案 »
- 怎样检测一篇UTF8编码的网页中的中文是否为繁体?
- delphi nt服务非常其怪的问题
- 用ShellTreeView控件显示做类似“资源管理器”的效果的问题?
- 散分___求--delphi 5 开发人员指南 附书源码!每人100分送!
- ★★关于《Delphi5 开发人员指南》8.7编写动画程序中的例子,无法运行,怎么回事?
- 基础问题(初学者)
- 各位高手看看我的密码登录程序,但却跳过不让我输入,望能指教。
- 如何判断一个程序是Win32程序?
- 请教!能否给一个stringGrid的例程,谢谢!
- 使用delphi能否让xml自动换行缩进
- 100分求 DevExpressVCL 傻瓜安装问题
- 小问题:TAdvStringGrid 注释
frxReport1.LoadFromFile('D:\1.fr3');
frxReport1.ShowReport();
好的,我试试! 能不能直接在一个类里边声明一下,类里边包括fastreport的相关组件,但是不创建窗体行吗?
Debugger Exception Notification
---------------------------
Project Rsa.exe raised exception class EAccessViolation with message 'Access violation at address 00000000. Read of address 00000000'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
procedure TFrm_AppSearch.BtnRefreshClick(Sender: TObject);
var
Str_SQL:String;
Str_Path,Str_RPFile:string;begin
inherited;
try
try
Str_SQL := ' select periodName,dlTo.DeptName DeptName,dlFrom.DeptName FromDeptName,convert( varchar(100), AppointTime, 23)AppointTime, ';
Str_SQL := Str_SQL + ' dbo.f_realName(app.ManCreate) ManCreate, app.* ';
Str_SQL := Str_SQL + ' from appointList app ';
Str_SQL := Str_SQL + ' left join periodList per ';
Str_SQL := Str_SQL + ' on app.periodID=per.periodID ';
Str_SQL := Str_SQL + ' left join DeptList dlTo ';
Str_SQL := Str_SQL + ' on app.DeptID=dlTo.ID ';
Str_SQL := Str_SQL + ' left join DeptList dlFrom ';
Str_SQL := Str_SQL + ' on app.FromDeptID=dlFrom.ID ';
Str_SQL := Str_SQL + ' where SNO=:SNO'; Query_RP.Close;
Query_RP.SQL.Clear; //打印报表
Query_RP.SQL.Add(Str_SQL);
Query_RP.Parameters.ParamByName('SNO').Value := Query_Search.FieldByName('SNO').AsString;
Query_RP.Open; Str_Path:= ExtractFilePath( Application.ExeName );
Str_RPFile := Str_Path + 'RP\rp3.fr3';
frxReport1.LoadFromFile(Str_RPFile);
frxReport1.PrepareReport();
frxReport1.PrintOptions.ShowDialog:=false;
frxReport1.print;
except
on E:Exception do
begin
Write_LogErr(FinalUnit+'0001:重新打印处',IntToStr(E.HelpContext)+':'+E.Message,'');
end;
end;//end except finally
Query_RP.Close;
end;//end finally
end;
frxReport1.LoadFromFile(Str_RPFile);
是不是这句话只能写一次,试试