Results 1 to 3 of 3

Thread: Printing Multiple Reports

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    108

    Printing Multiple Reports

    Is it possible to print multiple reports through looping and recordset movement? I want to print each records details in single paper only so have the following code (below) but I always get an automation error:

    With rptPropertyCard
    Set .DataSource = adoRst

    Do Until adoRst.EOF

    .Sections("Section1").Controls.Item("txtDate").DataField = "date_acqd"
    .Sections("Section1").Controls.Item("txtPAR").DataField = "item_no"
    .Sections("Section1").Controls.Item("txtAmount").DataField = "total_value"
    .Sections("Section1").Controls.Item("txtQty").DataField = "item_qty"
    .Sections("Section1").Controls.Item("lblUser").Caption = frmPAR.txtByEmpCode.Text

    .Sections("Section5").Controls.Item("lblSupplier").Caption = adoRst.Fields("supplier").Value
    .Sections("Section5").Controls.Item("lblRIV").Caption = adoRst.Fields("riv_no").Value
    .Sections("Section5").Controls.Item("lblPO").Caption = adoRst.Fields("po_no").Value
    .Sections("Section5").Controls.Item("lblFund").Caption = adoRst.Fields("fund").Value

    .Show vbModal

    adoRst.MoveNext

    Loop

    End With

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    Re: Printing Multiple Reports

    You could create a one page report by using only label controls. But the datasource must only have one record.
    This works,
    Code:
    Dim rs As New ADODB.Recordset, rs2 As New ADODB.Recordset
    '
        rs.Open "select crop from crops where crop='CORN'", conCnn
        rs2.Open "select crop from crops", conCnn
        
            
        Do While Not rs2.EOF
            With DataReport2
                Set .DataSource = rs
                .Sections("Section1").Controls("Label1").Caption = rs2!crop
                .Show vbModal
            End With
            rs2.MoveNext
        Loop
    It seems that creating grouping on the report with a page break after each group would be a better solution.

  3. #3
    New Member
    Join Date
    May 2009
    Posts
    4

    Re: Printing Multiple Reports

    Check for Batch Printing or Batch scheduling kind of APIs in the tool you are using. I have seen then in some tools..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width