Results 1 to 4 of 4

Thread: Page break on report

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    16

    Page break on report

    Greetings:

    In use VB6, Access2000, DataReport, No DataEnvironment


    This is a 2 part problem

    Part 1
    I'm trying to create a report, thats grouped by customer no.
    The report comes out bundled as a whole batch.
    I need to have the report separated by Customer No, in other words
    how do I go about implementing a page break when the customer no
    changes. The recorset is grouped as shown in the select for part 2.

    There is a forcedPageBreak option is the Datareport but I have no
    clue as to how to use it.


    Part 2
    For the same report I'm trying to sum the currency fields by column.
    The column totals only show the value from the first record in the
    recordset.

    As follows the select in use:


    RsSelect = " SELECT Vouchers.CustAcctNo, VoucherNo, " & _
    " VoucherUsedOnDate, VoucherUsedAtTime& "" "" &VoucherUsedAtTimeFlag as thetime, " & _
    " VoucherPassengerLastName & "", "" & VoucherPassengerFirstName as thename, " & _
    " VoucherPickupLocation, VoucherDropOffLocation, " & _
    " Format(VoucherFare, ""#,##0.00"") as VoucherFare, " & _
    " Format(Sum(VoucherStops), ""#,##0.00"") as VoucherStops, " & _
    " Format(Sum(VoucherWaitTime), ""#,##0.00"") as VoucherWaitTIme, " & _
    " Format(Sum(VoucherTolls), ""#,##0.00"") as VoucherTolls, " & _
    " Format(Sum(VoucherParking), ""#,##0.00"") as VoucherParking, " & _
    " Format(Sum(VoucherMeetGreet), ""#,##0.00"") as VoucherMeetGreet, " & _
    " Format(Sum(VoucherGratuity), ""#,##0.00"") as VoucherGratuity, " & _
    " Format(Sum(VoucherMiscellaneous), ""#,##0.00"") as VoucherMiscellaneous, " & _
    " VoucherService, " & _
    " Customers.CustCompanyName, Customers.CustDepartment, " & _
    " Customers.CustAddress1, Customers.CustAddress2, " & _
    " Customers.CustCity, Customers.CustState, Customers.CustZipcode, " & _
    " Customers.CustAuthorizedFirstName, Customers.CustAuthorizedLastName " & _
    " from Vouchers, Customers " & _
    " where VoucherStatus = 'Pending' " & _
    " and Vouchers.CustAcctNo = Customers.CustAcctNo " & _
    " group By Vouchers.CustAcctNo, VoucherNo, " & _
    " VoucherUsedOnDate, VoucherUsedAtTime, VoucherUsedAtTimeFlag, " & _
    " VoucherPassengerLastName, VoucherPassengerFirstName, " & _
    " VoucherPickupLocation, VoucherDropOffLocation, VoucherFare, VoucherService," & _
    " Customers.CustCompanyName, Customers.CustDepartment, Customers.CustAddress1, Customers.CustAddress2, Customers.CustCity, Customers.CustState, Customers.CustZipcode, Customers.CustAuthorizedFirstName, Customers.CustAuthorizedLastName "


    I know that I can use the report sum function, which returns the proper
    Totals, but what happens is that I need to format the currency in terms
    of dollars and cents which is why I use the format statement in this scenario.

    If I don't use the format, what happens is that the values are printed
    as: 7.7 if the amount is 7.70, which prints ok (7.70 using the format stmt).

    Can someone tell me what's wrong with the select?


    Thanks for your responses

    Donald

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Page break on report

    In order to use Grouping properly in the DataReport you must create a Hierarchical Recordset via Data Shaping. Check the help file for more information.

    Add a Group Header and Footer section to the report. Place the customer fields required in these sections and set the ForcePageBreak property of the Group Footer section to 2 - rptPageBreakAfter.

    Use the DataFormat property of each control to set the desired display format.

    I am not sure I understand # 2, can you clarify?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    16

    Re: Page break on report

    Thanks for the response Brucevde.

    Will try your suggestion for Part 1.

    as for Part2
    What happens is for ex: the the value to be printed is 7.70 I get 7.7 printed if I do not use the format function in the select statement.

    I would like to print x.xx (7.70) if the value ends in zero. If it's 7.75 it will print as 7.75. Hope you understand what I' tryin to accomplish. And again thanks for responding.

  4. #4
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Re: Page break on report

    Could either of you tell me what I am doing wrong, I am trying to do the same thing, programmitically break on certain records. But the pagebreak doesn't work for me. I am desparate for this. I have posted below, but no response..
    Thanks

    http://www.vbforums.com/showthread.p...forcepagebreak

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