Question : CR 2008 DB2 Line Item billing Reports without subreports

I am using CR 2008 to create reports from a DB2 database. The data is a line item billing system, so there is a client record with multiple charge records. Each charge record has a "Line No'. Each line number can have multiple payments and multiple adjustments, which are in separate tables.

Tables: Client, Charges, Payments, Adjustments.
I need to have a report showing"
   Client (Name, Account #, etc.)
     Charge 1     Total Payments for Charge 1     Total Adjustments for Charge 1
     Charge 2     Total Payments for Charge 2     Total Adjustments for Charge 2
 and so on.

I can do this with sub reports, but this takes a very long time to compile.

I can show "Charge 1     Total Payments for Charge 1"
or "Charge 1        Total Adjustments for Charge 1"

but not both with out the sub reports.

Any Ideas on how to best handle this?

Answer : CR 2008 DB2 Line Item billing Reports without subreports

Try this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
Sub Main()
SetupToPrint "ALL Sales"
SetupToPrint "New Sales"
SetupToPrint "Old Sales"
End Sub

Private Sub SetupToPrint(sh As String)
    
    Sheets(sh).Activate
    Call SetPrintAreaToPivotTable
    Call SetPageBreakToXNumberOfRows

End Sub

Private Sub SetPrintAreaToPivotTable()

    With ActiveSheet
        lPTcells = .PivotTables("PivotTable1").DataBodyRange.Cells.Count
        Set rngTopLeft = .PivotTables("PivotTable1").RowRange.Cells(1)
        Set rngBotRight = .PivotTables("PivotTable1").DataBodyRange.Cells(lPTcells)
        strPTAddress = rngTopLeft.Address & ":" & rngBotRight.Address 'strPT address don't exist!
        .PageSetup.PrintArea = strAddress
    End With

End Sub

Private Sub SetPageBreakToXNumberOfRows()

    Dim Lastrow As Long
        Dim Row_Index As Long
        Dim RW As Long
    
        'How many rows do you want between each page break
        RW = 48
        
        With ActiveSheet
            'Remove all PageBreaks
            .ResetAllPageBreaks
            
            'Search for the last row with data in Column D
            Lastrow = .Cells(Rows.Count, "D").End(xlUp).Row
            
            For Row_Index = RW + 2 To Lastrow Step RW
                .HPageBreaks.Add Before:=.Cells(Row_Index, 1)
            Next
    End With

End Sub
Random Solutions  
 
programming4us programming4us