怎样用QReport中的报表合并功能???既那个TQRCompositeReport组件怎么用,用的是delphi5

解决方案 »

  1.   

    下面是一段帮助文档,如果想要详细资料,给我发回复和Email地址。
    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.
      

  2.   

    至所以用组合报表的想法是这样的:要打印数据库中的一些数据,在打印这些数据前要加上一段说明;后来想把那段说明单独做成一页,从第二页开始打印从数据库中检索出来的数据,用通常的方法不行;所以想用组合报表试试,但试过以后发现两个都出现了同样的问题:像ColumnHeader这些东西很难控制啊
      

  3.   

    先把说明做成一张报表,
    再把数据做成一张报表,
    然后
    QRCompositeReport1.add(表1);
    QRCompositeReport1.add(表2);
    看看delphi qr自带的demo,就明白了