Results 1 to 10 of 10

Thread: report (2k)

  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    report (2k)

    I want to print some records in the report . for example evry page in the report contain about 15 line.
    Ashraf

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: report (2k)

    If I undestand you correctly, you want to print a subset of the data in a report. You can do this several ways.

    1. Change the dataset providing the data to the report. (I.e., Filer the data for the report first)

    2. In the report, go to design view. Select Properties. Go to the Data Tab. Set filter on to Yes. On the Filter line, input the filter you want to run similar to a where clause in a query. For example, [YourDataField] = "ValueToFilterOn"

    Post immediately edited for content

    HTH
    Regards,

    Gary
    (It's been a while!)

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: report (2k)

    Thank u for ur help but that i do not want . if i have a 50 record i want to print 15 record at the 1st page & 15 record at the 2nd page finly the last page is 20 record , that i want.
    Ashraf

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: report (2k)

    If you want a maximum number of records to be printed on *each* page, including the last, it is not too hard, but apparently you want to make an exception for the last page. That complicates things. What is the criterion to decide the number of records to be printed on the last page?
    50 = 15 + 15 + 20
    55 = 15 + 15 + 25 ?
    59 = 15 + 15 + 29 ?
    60 = 15 + 15 + 30 ? or 15 + 15 +15 + 15 ?

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: report (2k)

    The only way I can think to do this is to add a field used for grouping for your data supplying the report. For example, for the first 15 records the field could be 1, second 15 records, 2, and finally remainder of records 3. When you create your report bring in the new field but set its property to invisible so you don't see in the the report details. In the report properties, sorting and grouping, group on this field and group on each value. In the details section of the report, also go to properties, go to the format tab, and set the Force New Page to After Section.


    HTH
    Regards,

    Gary
    (It's been a while!)

  6. #6
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: report (2k)

    supoose that evry page has 20 record i mean 20+20+30

  7. #7
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: report (2k)

    Then set the grouping variable added to the data as needed to match your requirements. Group 1 has 20, 2 has 20, and 3 has 30.

    Actually, I would like to see Hans answer as well as I am curious as to how he would do this.
    Regards,

    Gary
    (It's been a while!)

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: report (2k)

    Here is one way to do it:
    <UL><LI>Put a text box in the detail section. Set Control Source to =1, Running Sum to Over All, Visible to False. Name it txtRecNum.
    <LI>Put another text box in the detail section. Set Control Source to =Count(*), Visible to False. Name it txtCount. Since both text boxes are invisible, they don't need to take up extra space, you may place them on top of visible controls.
    <LI>Put a page break in the detail section, immediately above the lower edge of the section, and below all other controls in this section. Name it brkPage.
    <LI>Create the following event procedure for the OnFormat event of the detail section:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Const conRecordsPerPage = 20
    brkPage.Visible = (txtRecNum Mod conRecordsPerPage = 0) And _
    (txtRecNum conRecordsPerPage <> txtCount conRecordsPerPage)
    End Sub

    <LI>The constant conRecordsPerPage determines the number of records on each page (except for the last); it is set to 20 here; if you want 15 records on a page, change 20 to 15.[/list]

  9. #9
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: report (2k)

    Thank u Mr.Hans it is good work
    Ashraf

  10. #10
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: report (2k)

    Very Neat Hans.

    Wish I knew this way sooner....
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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