怎样用QReport中的报表合并功能???既那个TQRCompositeReport组件怎么用,用的是delphi5
解决方案 »
- 帮忙分析一下function之Result
- 新手交流:TDBGrid原生对多表头的支持,可以任意扩展,收缩多层表头到单层或部分单层,不要误会DBGrid不支持多表头
- 怎么在stringgrid单元格中动态加载图片
- 一道真正的智力题,据说是世界上目前最好的智力题目
- 一个视频卡和几个摄像头,现在想做一个现场监视。不知道要什么组件以前没做过,也没思路。麻烦各位以下帮帮忙……
- 怎么实现delphi叠加的界面,马上给分!
- 请教高手 建造一个c/s数据库??
- 怎么移动框架,满分求助
- 怎么使报表中的数据是当前数据库中最新的数据?
- 高分解决急用问题(300)
- 有谁会用rave达因是怎么用呀。
- 又有一个delphi论坛成立了,大家去支持一下! http://www.91delphi.com
QRCompositeReport. Sometimes you need to group together separate reports into a single print run. For example, maybe you need to print out all the new customers obtained in the last week, together with a summary of all orders in the last week and also a list of stock that needs reordering. As far as your customer is concerned these things belong together and should be printed together. But from the database point of view you will want to use three separate TQuickRep components to do the job.
The way to handle this situation is to use a TQRCompositeReport component. Drop one on the form where you want to kick off the printing. First you need to define a handler for its OnAddReports event, which calls the TQRCompositeReport.Add method to add all the TQuickRep components you need to print. Suppose the reports you want to print are held on forms called RepNewCust, RepOrderSummary and RepStockReorder, and in each case the TQuickRep component on the form is called ‘Report’ (see the section ‘TQuickRep in detail’ below for why you might do this). Then your OnAddReports event handler should look like this:procedure TForm1.QRCompositeReport1AddReports(
Sender: TObject);
begin
QRCompositeReport1.Reports.Add(RepNewCust.Report);
QRCompositeReport1.Reports.Add(RepOrderSummary.Report);
QRCompositeReport1.Reports.Add(RepStockReorder.Report);
end;(If you don’t mind using the with statement in your code, you can tidy up this fragment considerably by wrapping it up in
with QRCompositeReport1.Reports do
begin
...
end;and knocking out the ugly repetitive QRCompositeReport1.Reports from the middle three lines.)
Now you can call QRCompositeReport1.Print to print out all three reports in a single batch, and QRCompositeReport1.Preview to preview them together. There are also TQRCompositeReport component properties that let you set up paper sizes and set an overall title for the composite report – basically everything you need to handle the output from the multiple reports in one place.
再把数据做成一张报表,
然后
QRCompositeReport1.add(表1);
QRCompositeReport1.add(表2);
看看delphi qr自带的demo,就明白了