效果是  房屋信息+(成员1,2,3,---N) 一页
如果成员多了 超过一页 就接着 房屋信息+(N+1---N+M)
主从表的关系

解决方案 »

  1.   

    用基本的rbPageHeader,rbColumnHeader,rbDetail就可以实现啊,应该不是很麻烦的
      

  2.   

    在QREPORT中要绑定ADOQUERY和ADOTABLE
    房屋信息=ADOQUERY   成员=ADOTABLE  ADOQUERY和ADOTABLE有个公共的字段 已经绑定
    翻页的时候 是ADOQUERY数据的滚动,ADOTABLE的数据跟着变动
      

  3.   

    我还是把代码贴出来
    object Form1: TForm1
      Left = 187
      Top = 88
      Width = 589
      Height = 476
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      Scaled = False
      PixelsPerInch = 96
      TextHeight = 13
      object DBGrid1: TDBGrid
        Left = 112
        Top = 8
        Width = 441
        Height = 81
        DataSource = DataSource1
        TabOrder = 0
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'MS Sans Serif'
        TitleFont.Style = []
      end
      object Button1: TButton
        Left = 24
        Top = 104
        Width = 75
        Height = 25
        Caption = 'close'
        TabOrder = 2
        OnClick = Button1Click
      end
      object QuickRep1: TQuickRep
        Left = 16
        Top = 168
        Width = 545
        Height = 265
        Frame.Color = clBlack
        Frame.DrawTop = False
        Frame.DrawBottom = False
        Frame.DrawLeft = False
        Frame.DrawRight = False
        DataSet = ADOQuery1
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Arial'
        Font.Style = []
        Functions.Strings = (
          'PAGENUMBER'
          'COLUMNNUMBER'
          'REPORTTITLE')
        Functions.DATA = (
          '0'
          '0'
          '''''')
        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 = MM
        Zoom = 100
        object QRSubDetail2: TQRSubDetail
          Left = 38
          Top = 97
          Width = 469
          Height = 32
          Frame.Color = clBlack
          Frame.DrawTop = True
          Frame.DrawBottom = True
          Frame.DrawLeft = True
          Frame.DrawRight = True
          AlignToBottom = False
          Color = clWhite
          ForceNewColumn = False
          ForceNewPage = False
          Size.Values = (
            84.6666666666667
            1240.89583333333)
          Master = QuickRep1
          DataSet = ADOTable1
          HeaderBand = QRBand1
          PrintBefore = False
          PrintIfEmpty = True
          object QRDBText3: TQRDBText
            Left = 56
            Top = 8
            Width = 31
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              148.166666666667
              21.1666666666667
              82.0208333333333)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Color = clWhite
            DataSet = ADOTable1
            DataField = 'CNID'
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
          object QRDBText4: TQRDBText
            Left = 240
            Top = 0
            Width = 36
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              635
              0
              95.25)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Color = clWhite
            DataSet = ADOTable1
            DataField = 'PayID'
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
        end
        object QRBand1: TQRBand
          Left = 38
          Top = 38
          Width = 469
          Height = 59
          Frame.Color = clBlack
          Frame.DrawTop = True
          Frame.DrawBottom = True
          Frame.DrawLeft = True
          Frame.DrawRight = True
          AlignToBottom = False
          Color = clWhite
          ForceNewColumn = False
          ForceNewPage = False
          Size.Values = (
            156.104166666667
            1240.89583333333)
          BandType = rbGroupHeader
          object QRDBText1: TQRDBText
            Left = 56
            Top = 24
            Width = 31
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              148.166666666667
              63.5
              82.0208333333333)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Color = clWhite
            DataSet = ADOQuery1
            DataField = 'CNID'
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
          object QRDBText2: TQRDBText
            Left = 224
            Top = 24
            Width = 73
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              592.666666666667
              63.5
              193.145833333333)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Color = clWhite
            DataSet = ADOQuery1
            DataField = 'CONTACTID'
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
          object QRLabel1: TQRLabel
            Left = 120
            Top = 24
            Width = 58
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              317.5
              63.5
              153.458333333333)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Caption = 'QRLabel1'
            Color = clWhite
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
        end
      end
      object DBGrid2: TDBGrid
        Left = 112
        Top = 94
        Width = 441
        Height = 106
        DataSource = DataSource2
        TabOrder = 1
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'MS Sans Serif'
        TitleFont.Style = []
      end
      object Button2: TButton
        Left = 24
        Top = 48
        Width = 75
        Height = 25
        Caption = 'preprint'
        TabOrder = 4
        OnClick = Button2Click
      end
      object DataSource1: TDataSource
        DataSet = ADOQuery1
        Left = 304
        Top = 64
      end
      object DataSource2: TDataSource
        DataSet = ADOTable1
        Left = 280
        Top = 176
      end
      object ADOConnection1: TADOConnection
        Connected = True
        ConnectionString = 
          'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initi' +
          'al Catalog=housesys;Data Source=siyuan'
        LoginPrompt = False
        Provider = 'SQLOLEDB.1'
        Left = 376
        Top = 24
      end
      object ADOTable1: TADOTable
        Active = True
        Connection = ADOConnection1
        CursorType = ctStatic
        IndexFieldNames = 'CNID'
        MasterFields = 'CNID'
        MasterSource = DataSource1
        TableName = 'VPAYCONTACT'
        Left = 312
        Top = 176
      end
      object ADOQuery1: TADOQuery
        Active = True
        Connection = ADOConnection1
        CursorType = ctStatic
        Parameters = <>
        SQL.Strings = (
          'select * from contact where cnid in (1,4)')
        Left = 344
        Top = 64
      end
    end